Question: 1. Consider a hypothetical machine with three instructions 0001 = Load AC from memory 0010 = Store AC to memory 0101 = Add to AC

1. Consider a hypothetical machine with three instructions 0001 = Load AC from memory 0010 = Store AC to memory 0101 = Add to AC from memory Consider the 16 bits instruction format as 4 bits for opcode and 12 bits for address Consider a program that adds the contents of the memory word at address 940H to the contents of the memory word at the address 941H and stores the result in the later location. The address of the first instruction is 300H. Write hex code for this program. Follow the execution of this program using the Figure below: - Fetch stage Execute stage Memory CPU registers Memory CPU registers 300 1 9 4 0 3 0 0 PC 3 0 1PC 301 5 9 4 1 AC 301 5 9 4 1 O O O 3 AC 302 2 9 4 1 1 9 4 0 IR 302 2 9 4 1 1 9 4 O IR 940 0 0 0 941 0 0 0 3 2 Step 1 Memory 3001 9 4 0 301 5 9 4 1 302 2 9 4 1 940 0 0 0 3 941 0 0 0 2 Step 2 CPU registers Memory 3 0 1PC 300 1 9 4 0 O 0 0 3] AC 301 5 9 4 1 5 9 4 1 IR 3022 9 4 1 CPU registers 3 0 2PC 0 0 0 5 AC 5 9 4 1 IR 3 + 2 = 54 940 0 0 0 3 941 0 0 0 2 Step 3 Memory 3001 94 0 301 5 9 4 1 302 2 9 4 1 940 0 0 0 3 941 0 0 0 2 Step 4 CPU registers | Memory 3 0 2 PC 300 1 9 4 0 O O O 5 AC 301 5 9 4 1 2 9 4 1 IR 302 2 9 4 1 CPU registers 3 0 3 PC O O O 5 AC 2 9 4 1 IR 940 0 0 0 941 0 0 0 Step 5 3 2 940 0 0 0 941 O O O Step 6 3 5 Example of Program Execution (contents of memory and registers in hexadecimal)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
