View worked solution
Answer: 15
In an in-order instruction pipeline, an instruction can enter a stage only after:
- It has completed the previous stage .
- The preceding instruction has cleared stage .
Thus, the start time for any stage is given by:
and the end time is:
Tracing the execution cycle-by-cycle for each instruction:
| Inst. | Fetch (F) | Decode (D) | Execute (E) | Write (W) |
|---|---|---|---|---|
| I1 | 0 – 1 | 1 – 3 | 3 – 4 | 4 – 5 |
| I2 | 1 – 2 | 3 – 5 | 5 – 7 | 7 – 8 |
| I3 | 2 – 4 | 5 – 6 | 7 – 10 | 10 – 12 |
| I4 | 4 – 5 | 6 – 9 | 10 – 12 | 12 – 13 |
| I5 | 5 – 6 | 9 – 11 | 12 – 13 | 13 – 15 |
The final stage (Write) of the last instruction (Instruction 5) completes at clock cycle 15.
Free practice · Your answers on this page are not saved.
