Question: Question 1: Machine code for four instruction set architechtures. Descriptions Be sure to clearly state any assumptions that you make in solving these problems. Use



Be sure to clearly state any assumptions that you make in solving these problems. Use the notation used in lecture and the handouts when referring to fields in a pipeline stage register. Carefully state the units of any answers you give. The first two problems in this set are a continuation of Questions 1-4 on Homework Set #1. Refer to the architecture descriptions there. Assume that for all four instruction set architectures: The opcode is always six bits. All data operands are eight bytes (that is, 64 bits). All memory addresses are eighteen bits, using direct addressing. (That is, an 18-bit fiecld in the machine code is a direct pointer to a data memory with 2" bytes.) In the data memory, assume A is at address Ox 1E500, B is at OXIE508, C is at Ox1E510, and D is at OXIE518. Each architecture uses a fixed length instruction set (that is, every instruction used by that architecture has the same integer number of bytes). Machine code for the four instruction set architectures Question 1. (a) How many bytes are needed for each instruction for the accumulator architecture? Show how you would arrange the fields for the instructions STORE A and MUL D. Show the resulting machine code for these instructions in hexadecimal, assuming STORE has the opcode Ox01 and MUL has the opcode Ox03. (b) How many bytes are needed for each instruction for the stack architecture? Show how you would arrange the fields for the instructions PUSH A and MUL. Show the resulting machine code for these instructions in hexadecimal, assuming PUSH has the opcode Ox00 and ADD has the opcode Ox02. Mul opcode = Ox03 (c) How many bytes are needed for each instruction for the two-address load-store architecture? Assume it has 32 working registers in the register file. Show how you would arrange the fields for the instructions STORE A, RI and MUL R2, R1. Show the resulting machine code for these instructions in hexadecimal, assuming STORE has the opcode 0x01 and MUL has the opcode Ox03. (d) How many bytes are needed for each instruction for the three-address memory-memory architecture? Show how you would arrange the fields for the instruction ADD A, A, D. Show the resulting machine code for this instructions in hexadecimal, assuming ADD has the opcode Ox02. Comparing the four instruction set architectures Question 2. Please base your answers on the code in the posted solutions (rather than on the code you turned in). Make a table to compare the four architectures, showing: [Note which architectures result in (a) The code size in bytes needed to implement A = A+ A* D. less demand for program memory.] HOMEWORK POLICY: While it is fine to discuss possible approaches to these problems with fellow students, you must work independently when you actually sit down to work out the answers. Homework is due at the beginning of lecture on the due date. Please show your work, and carefully state any assumptions you make in solving these problems. The first four questions consider four architecture styles. (You can find more information about these architectures in Appendix A, Section A.2 of the text. Note that the MIPS is a three-address load-store architecture, yet another style.) All four machines are non-pipelined, with a perfect memory system. (Then, each instruction requires exactly one clock cycle.) For each machine, you will write assembly language code to do the computation A=A+A*D. Write your code efficiently, and comment each line with a register transfer level (RTL) description of the function of that line. /Question 1. An accumulator architecture An accumulator architecture is simple but still used on many microcontrollers. Every math operation uses a special working register called the accumulator as one of its two inputs, and puts its result back into the accumulator. Suppose that the accumulator architccture uses a 100 ns clock cycle and has the following instructions: Reads the memory at the given address and puts the data in the LOAD
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
