

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Machine code is a useful abstraction in that it gives you a feel for how some pseudo code might actually be executed on a given microprocessor, yet also abstracts away some of the “gory detail” associated with the process (i.e. a “1s” and “0s” representation). In this question we start with machine code, “look up” in Part A, and “look down” in Part B. Assume that you have the following sequence of instructions from the 3-instruction processor:
The four questions listed below all require short answers. These questions are included to give you more practice working with instruction mnemonics. The primary purpose of these questions is to tie the notion of an “instruction” to a block diagram that is representative of the hardware thatʼs actually necessary to execute an instruction. You might want to refer to the datapath diagram for the 3- instruction and 6-instruction processor in your notes. Question A: (3 points) For the 3-instruction processor, is it possible to multiply a number by 16 in less than 10 clock cycles (CCs)? (Note: be sure to include the time to fetch and decode the instruction in your answer.) Question B: (4 points) For the 6 - instruction processor, what is the minimum number of clock cycles required to add together (i) the constant 5, (ii) a piece of data in memory, (iii) a piece of data already in a register and then to save the result in 3 different memory locations. Again, include the time spent fetching and decoding. Question C: (4 points) For the operation described in Question B, how might you modify the 6-instruction datapath to reduce the number of CCs required? By how much would you improve performance? (Be quantitative and explain.) Question D: (3 points) For the 3-instruction processor, how many instructions are required to swap the data in R1 with the data in R4? (Show your sequence of instructions for partial credit.)
For the 3-instruction processor, assume that you wanted to have instructions that (i) always adds the constant 1 to a register (i.e. Add R4, R5, #1 or Add R5, R5, #1) and (ii) allowed you to add 2 numbers together in memory and write the result back to register file. How would you modify the 3-instruction datapath so that the least amount of hardware is required? Illustrate below.
In CSE 30321 youʼll frequently do assignments and readings that are centered on machine instructions. However, itʼs important to remember that all datapaths do not have the same hardware, all datapaths might not look like that those for the 3-instruciton or 6-instruction processor, etc. By looking at the sequence of instructions that might evolve from pseudo code, you can actually make some inferences as to the capability of the machine itself. The purpose of this question is to get you thinking about this concept. Letʼs assume that you have 3 pieces of data – A, B, and C.