Assume that the following sequence of instructions is executedon a 5-stage pipelined datapath:
ADD R5,R2,R1
LW R3,4(R5)
LW R2,0(R2)
OR R3,R5,R3
SW R3,0(R5)
a. If there is no forwarding or hazard detection, insert NOPs toensure correct execution. (10)
b. Now use nops only when a hazard cannot be avoided by changingor rearranging these instructions. You can assume register R7 canbe used to hold temporary values in your modified code. (10)
Expert Answer
An answer will be send to you shortly. . . . .