GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A classic 5-stage pipeline (IF, ID, EX, MEM, WB) runs: I1: ADD R1, R1, R2; I2: ADD R3, R1, R4; I3: ADD R5, R3, R1; I4: LW R6, 0(R5); I5: ADD R7, R6, R3; I6: SW R7, 0(R5). Without hazards I1 finishes WB in cycle 5. Machine N has no forwarding but a split-cycle register file (a consumer may be in ID in its producer's WB cycle); machine F has full forwarding to the ALU inputs, so only a load followed immediately by a user stalls, for one cycle. In which cycle does I6 finish WB on N and on F?

  1. A. 25 and 11
  2. B. 20 and 10
  3. C. 20 and 11
  4. D. 18 and 11

Correct answer: C. 20 and 11

N: every instruction depends on the one before, so each ID comes 3 cycles after the previous ID: I1 2, I2 5, I3 8, I4 11, I5 14, I6 17 → WB 20. F: only I4 → I5 is a load-use pair, 10 + 1 = 11. Without the split register file N would need 25.

More Computer Organization and Architecture questions

Exams that ask this topic