write my assignment 17215

SEARCH: LW R5,0(R3) /I1 Load item

SUB R6,R5,R2 /I2 Compare with key

BNEZ R6,NOMATCH /I3 Check for match

ADDI R1,R1,#1 /I4 Count matches

NOMATCH: ADDI R3,R3,#4 /I5 Next item

BNE R4,R3,SEARCH /I6 Continue until all items

Branches are predicted untaken always and are taken in EX1 if needed. Hardware support for branches is included in all cases. Consider several possible pipeline interlock designs for data hazards and answer the following questions for each loop iteration, except the last one.

a. Assume first that the pipeline has no forwarding unit and no hazard detection unit. Values are not even forwarded inside the register file. Re-write the code by inserting NOOPs wherever needed so that the code will execute correctly on this simplest of machine.

b. Next, assume no forwarding at all, but a hazard detection unit that stalls instructions in ID to avoid hazards. How many clocks does it take to execute one iteration of the loop 1) on a match and 2) on no match.

c. Next, assume register forwarding and a hazard detection unit that stalls instructions in ID to avoid hazards. How many clocks does it take to execute one iteration of the loop 1) on a match and 2) on no match.

d. Next, assume full forwarding and a hazard detection unit that stalls instructions in ID to avoid hazards. How many clocks does it take to execute one iteration of the loop 1) on a match and 2) on no match.

e. Finally assume a machine with full forwarding, but no hazard detection unit. Re-write the code by inserting

NOOPs wherever needed so that the code will execute correctly.

 
"Not answered?"
Get the Answer