from Computer Organization and Design, Fourth Edition (Revised Printing)
Problems:
If the time for an ALU operation can be shortened by 25% (compared to the description in Figure 4.26 on page 333 of the textbook):
a. Will it affect the speedup obtained from pipelining? If yes, by how much? Otherwise, why?
b. What if the ALU operation now takes 25% more time?
Identify all of the data dependencies in the following code. Which are data hazards that can be resolved with forwarding? Which are data hazards that will cause a stall?
add $3, $4, $2 sub $5, $3, $1 lw $6, 200($3) add $7, $3, $6
Consider executing the following code on the pipelined datapath of Figure 4.60 on page 375 of the textbook:
add $2, $3, $1 sub $4, $3, $5 add $5, $3, $7 add $7, $6, $1 add $8, $2, $6
At the end of the fifth cycle of execution, which registers are being read and which register will be written?
With regard to the program in the previous question, explain what the forwarding unit is doing during the fifth cycle of execution. If any comparisons are being made, mention them.
With regard to the program in the next-to-previous question, explain what the execution unit is doing during the fifth cycle of execution. If any comparisons are being made, mention them.