In this exercise, we examine in detail how an instruction is executed in a singl
ID: 3697881 • Letter: I
Question
In this exercise, we examine in detail how an instruction is executed in a single-cycle datapath. Problems in this exercise refer to a clock cycle in which the processor fetches the following instruction word from address 128:
(i) 0001 0100 0110 0010 0000 0000 0001 0100
(ii) 0000 0000 1000 0010 0000 1000 0010 1010
For each instruction, answer the following questions.
(a) What is this instruction in assembly language notation? To figure this out, see pages A51-A80 of your textbook. What are the outputs of the sign-extend and the jump “Shift left 2” unit (near the top of the figure) for this instruction word?
(b) What are the values of the ALU control unit’s inputs for this instruction? You will need the table at the bottom of page 301 of your textbook.
(c) What is the new PC address after this instruction is executed?
Similar to textbook reference in (a) http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html
Explanation / Answer
(i) 0001 0100 0110 0010 0000 0000 0001 0100
Breaking it up into opcode and arguments,
0001 01 - BNE ( Branch if not equal to )
00 011 - $rs
0 0010 - $rt
0000 0000 0001 0100 - $offset
The result of sign-extend will be 0000 0000 0000 0000 0000 0000 0001 0100 ( Decimal 20 )
The result of Shift left 2 will be 0000 0000 0000 0000 0000 0000 0101 0000 ( Decimal 80 )
ALU control unit’s input for this instruction is 0110 (subtract)
PC address after this instruction is 128 + 80 = 208
(ii) 0000 0000 1000 0010 0000 1000 0010 1010
Breaking it up into opcode and arguments,
0000 00 - SLT ( Set on less than )
00 100 - $rs
0 0010 - $rt
0000 1 - $rd
The result of sign-extend will be 0000 0000 0000 0000 0000 1000 0010 1010 ( Decimal 2090)
The result of Shift left 2 will be 0000 0000 0000 0000 0010 0000 1010 1000 ( Decimal 8360 )
ALU control unit’s input for this instruction is 0111(set on less than)
PC address after this instruction is 128 + 4= 132
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.