MALAYSIAN INSTITUTE OF INFORMATION
TECHNOLOGY
UNIVERSITI KUALA LUMPUR
Lecturer : Pn. Sayani binti Puteh
Subject : ICB 10203 Computer Organization / INB 12303 IT & Applications
ASSIGNMENT 2 (15%) : PROCESSOR
Objectives of this assignment are :
• To sharpen the skills in programming (high level and low level) by using
LMC as the tool.
• To develop analytical skill in simulating the fetch-execute cycle in CPU.
• To realize the function of registers in CPU
• To develop teamwork and time management skills
INSTRUCTION : Answer ALL questions.
QUESTIONS:
1. Suppose the following instructions are found at the given locations in memory :
20 LDA 50
21 ADD 51
50 724
51 006
a. Show the contents of IR, PC, MAR, MDR and A at the end of execution
of instruction 20.
b. Show the contents of IR, PC, MAR, MDR and A at the end of execution
of instruction 21.
2. Write a simple LMC program (use the LMC 3-digit instruction set as given in the
APPENDIX) for the following pseudo code: [Assume the starting address of the
program is 05 ]
Operations :
User input data
If input = 0
End.
Else if input <0 (negative)
Store input in memory 88
Else
Display (output)
End.
APPENDIX :
LMC INSTRUCTION SET :
Arithmetic 1xx ADD
2xx SUB
Data Movement 3xx STORE
5xx LOAD
BR 6xx JUMP
BRZ 7xx BRANC ON 0
BRP 8xx BRANCH ON +
Input/Output 901 INPUT
902 OUTPUT
Machine Control 000 HALT
(coffee break) COB
DUE FOR SUBMISSION : 6TH SEPTEMBER 2010 (MONDAY)
IMPORTANT : Late submission may cause your marks be deducted
by the number of days late !
WARNING !!
COPYRIGHT :
Whatever work / answer you produce using your own idea and initiative is consider your
COPYRIGHT. Do not allow your friends copy from you. If any same work / answer is
found, I will give ZERO mark to both the original owner and the ‘copier’ !!
So, please keep your answer in the safe mode and submit into my PIGEON HOLE …
DO NOT LEAVE YOUR ASSIGNMENT ON MY TABLE!!!