Multiple choice

Consider an instruction pipeline with five stages without any branch prediction. Fetch Instruction (FI), Decode Instruction (DI), Fetch Operand (FO), Execute Instruction (EI) and Write Operand (WO). The stage delays for FI, DI, FO, EI and WO are 5 ns, 7 ns, 10 ns, 8 ns and 6 ns respectively. There are intermediate storage buffers after each stage and the delay of each buffer is 1 ns. A program consisting of 12 instructions I1, I2, I3, ….. I12 is executed in this pipelined processor. Instruction I4 is the only branch instruction and its branch target is 9 I9. If the branch is taken during the execution of this program, the time (in ns) needed to complete the program is

  1. 132

  2. 165

  3. 176

  4. 328

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Total clock slots taken are 16. Each slot will take maximum of {5, 7, 10, 8, 7} = 10. Hence, total slots for all the instructions = 16 × 10 + 16 (pipeline delay) = 176