Professional Documents
Culture Documents
Students are required to simulate a simple CPU that would be executing a program brought inti
memory for execution. Memory is of 4096 words (can be implemented as an array of short
ints).
This program (CPU Simulator) would be flexible in that it must be able to execute any program
(consisting any number of 16-bits instructions and any number of variables/data)
CPU will contain the following registers
1. AC
2. PC
3. IRMAR
4. MBR
Program will run and displays like this for every statement
Executing statement #1
Statement is Load
Executed….
Executing statement # 2
Statement is Add
Executed….
Terminating program
Result is
AC=------, PC=-------
TESTING
Test your CPU against the following programs
Show state of the CPU (Means all register’s value) when program terminates
a) With 4-bit OP-Code, how many operations are possible? If we want to design a CPU that would
be able to execute 256 operations…. what would be done at machine level?
b) Operand is taken from memory…by 12-bit address …. what do you think are the other places,
operands can be stored?