Pipelining & Hazards

Answer & solution
Official answer: 1.87 to 1.88
Our answer: 1.88
With forwarding, dependent instructions enter EX immediately after the previous EX result is ready. EX occupies cycles 3; 4–5; 6; 7–8; 9; 10–11; 12; 13–14. The last WB is cycle 16. Without forwarding, register operands must wait for the previous instruction to finish WB: EX intervals 3; 6–7; 10; 13–14; 17; 20–21; 24; 27–28, and final WB30. Thus speedup=30/16=1.875, rounding to 1.88, inside official 1.87–1.88. This uses the intended cycle-boundary model: a WB result becomes available to an EX register read in the following cycle. Allowing same-cycle WB-to-EX visibility would require a different timing convention; the prompt does not explicitly specify subcycle register timing.
For any instruction with EX finishing in cycle c, MEM occurs c+1 and WB c+2. Forwarding allows the dependent EX to start c+1, whereas the adopted no-forwarding convention requires c+3. Initial IF,ID place first EX in cycle 3; the last instruction then needs two drain cycles after EX. Counting only EX work or omitting pipeline fill/drain produces an incorrect speedup.


