Assignment 2
Assignment 2
TECHNOLOGY
UNIVERSITI KUALA LUMPUR
• 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
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 :
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!!!