Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Translate the following super simple CPU machine code to the assembly. Look at the first four bits of each memory cell and find those

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1. Translate the following super simple CPU machine code to the assembly. Look at the first four bits of each memory cell and find those bit patterns in the opcodes key. Write down the corresponding three-letter mnemonic. As you may remember the remaining 12 bits is operand. 0100000000001000 1010000000000100 0010000000000101 1000000000000001 1111000000000000 0000000000000100 2. Run the above program (question 1) manually. Assume the remaining memory cells (except the first 6 cells that have been assigned to the above 6 instructions) are initialized to 0. Keep columns for the instruction address (PC) and the accumulator value after the instruction executes (show the results in the following table). The initial values before the execution starts are shown in the table. (pc) instruction executes the following table),. The in tie ACC 0 PC 3. What does this program actually do? Binary Opcode Description 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 accumulator 0010 SUB just like ADD, only subtract. 0011 LOD fetch a number from memory and store it into the accumulator replacing its old value E.g. 0011000000001111get the value at memory location 15 and store that value into the accumulator 0100 LDI load immediate; the value (data) to be put into the accumulator is the operand (the rightmost 12 bits of the instruction); do not go to memory like LOD E.g. 0100000000001111 store the accumulator's value into memory at the indicated location. E.g. 0101000000001111 store the accumulator's value into memory location 15. 0101 STO Binary Opcode Description ask the user for one number and store that into the accumulator. send the value in the accumulator to the output area. 01 10 INP OUT JMP jump to the instruction at the indicated memory address. 0111 1000 E.g. 1000000000001111 put the value 15 into the PC which will cause the next instruction to be taken from location 15 of 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. 1001000000001111put the value 15 into the PC if accumulator

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago