A 5-stage pipeline with full forwarding runs 200 instructions. There are 30 load-use dependences, each causing a 1-cycle stall, and no other hazards. How many clock cycles are needed?
Correct answer C. 234
Explanation
Without stalls the run takes 5 + 200 - 1 = 204 cycles, and each load-use stall adds one more, giving 204 + 30 = 234. Forwarding removes ALU-to-ALU stalls, but a loaded value is only available after the memory stage, so a dependent instruction immediately after a load must still wait one cycle. 230 forgets the 4 fill cycles.
Answer checked How we write and check questions
Discussion