Question: Consider the following Super Simple CPU program. Trace the code and determine what the final values in Mem[11] (memory location 11), Mem[12], and Mem[13] will

Consider the following "Super Simple CPU" program. Trace the code and determine what the final values in Mem[11] (memory location 11), Mem[12], and Mem[13] will be after the program has executed. The original values are given

Consider the following "Super Simple CPU" program. Trace the code and determine

what the final values in Mem[11] (memory location 11), Mem[12], and Mem[13]

Consider the following "Super Simple CPU" program. Trace the code and determine what the final values in Mem[11] (memory location 11), Mem[12], and Mem[13] will be after the program has executed. The original values are given 12 Accumulator Mem [11] 2 Mem [12] 5 Mem [13] 0 0 TOP SUB JZR JNG STO JMP XX STO STP YY STP 11 12 13 LOD 11 XX YY 12 TOP LDI 13 1 STO 13 DAT DAT DAT 2 5 Super Simple CPU Instructions Set 1111 STP This stops the computer; no more fetch/decode/execute cycles until you reset. 0001 ADD Fetch a number from memory and add it to the contents of the accumulator, replacing the value in the accumulator. (E.g., 0001000000001111: Get the value at memory location 15 and add that to the accumulator.) 0010 SUB Fetch a number from memory and subtract it from the contents of the accumulator, replacing the value in the accumulator. 0011 LOD Fetch a number from memory and store it in the accumulator, replacing the accumulator's old value. (E.g., 0011000000001111: Get the value at memory location 15 and store that value in the accumulator.) 0100 LDI Load immediate; the value to be put in the accumulator is the operand (the rightmost 12 bits of the instruction); do not go to memory like LOD. (E.g., 0100000000001111: Store the value 15 in the accumulator.) 0101 STO Store the accumulator's value in memory at the indicated location. (E.g., 0101000000001111: Store the accumulator's value in memory location 15.) 0110 INP Ask the user for one number and store that in the accumulator. 0111 OUT Copy the value in the accumulator to the output area. 1000 JMP Jump to the instruction at the indicated memory address. (E.g., 1000000000001111: Put the value 15 into the PC, which will cause the next instruction to be taken from location 15 of the memory.) 1001 JNG Jump to the instruction at the indicated memory location if the accumulator's value is negative; otherwise just add 1 to the PC. (E.g., 1001000000001111: Put the value 15 into the PC, if accumulator

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!