Question: Repeat 4.21.1 but now use NOPs only when a hazard cannot be avoided by changing or rearranging these instructions. You can assume register R7 can
Repeat 4.21.1 but now use NOPs only when a hazard cannot be avoided by changing or rearranging these instructions. You can assume register R7 can be used to hold temporary values in your modified code.
Problem 4.21.1
If there is no forwarding or hazard detection, insert NOPs to ensure correct execution.
This exercise is intended to help you understand the relationship between forwarding, hazard detection, and ISA design. Problems in this exercise refer to the following sequences of instructions, and assume that it is executed on a 5-stage pipelined datapath:
a. b. ADD R5, R2, R1 LW R3,4 (R5) LW R2,0(R2) R3, R5, R3 OR SW R3,0(R5) LW R2,0 (R1) AND R1, R2, R1 LW R3,0(R2) LW R1,0 (R1) R1,0 (R2) SW Instruction sequence
Step by Step Solution
3.40 Rating (147 Votes )
There are 3 Steps involved in it
To address the hazards in the given sequence of instructions without using NOPs unless necessary we ... View full answer
Get step-by-step solutions from verified subject matter experts
