GateAI
Instruction Pipelining

GATE CSE 2013 · Q45

MCQ2 marksHard

Time

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\text{I}_1, \text{I}_2, \text{I}_3, \dots, \text{I}_{12} is executed in this pipelined processor. Instruction I4\text{I}_4 is the only branch instruction and its branch target is I9\text{I}_9. If the branch is taken during the execution of this program, the time (in ns) needed to complete the program is

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) 165

Instruction Pipelining
  1. Clock Cycle Time (τ\tau):

    τ=max⁡(Stage Delays)+Buffer Delay=max⁡(5,7,10,8,6)+1=10+1=11 ns\tau = \max(\text{Stage Delays}) + \text{Buffer Delay} = \max(5, 7, 10, 8, 6) + 1 = 10 + 1 = 11\text{ ns}
  2. Execution Flow and Pipeline Stalls:

    • The instructions successfully executed are I1,I2,I3,I4\text{I}_1, \text{I}_2, \text{I}_3, \text{I}_4 followed by the target instructions I9,I10,I11,I12\text{I}_9, \text{I}_{10}, \text{I}_{11}, \text{I}_{12} (total 88 committed instructions).

    • Without branch prediction, the processor continues fetching sequential instructions (I5,I6,I7\text{I}_5, \text{I}_6, \text{I}_7) until the branch outcome is determined in the Execute Instruction (EI) stage (Stage 4).

  3. Cycle-by-Cycle Pipeline Trace:

    • Cycle 1: I1\text{I}_1 in FI

    • Cycle 2: I1\text{I}_1 in DI, I2\text{I}_2 in FI

    • Cycle 3: I1\text{I}_1 in FO, I2\text{I}_2 in DI, I3\text{I}_3 in FI

    • Cycle 4: I1\text{I}_1 in EI, I2\text{I}_2 in FO, I3\text{I}_3 in DI, I4\text{I}_4 in FI

    • Cycle 5: I1\text{I}_1 in WO, I2\text{I}_2 in EI, I3\text{I}_3 in FO, I4\text{I}_4 in DI, I5\text{I}_5 in FI

    • Cycle 6: I2\text{I}_2 in WO, I3\text{I}_3 in EI, I4\text{I}_4 in FO, I5\text{I}_5 in DI, I6\text{I}_6 in FI

    • Cycle 7: I3\text{I}_3 in WO, I4\text{I}_4 in EI (branch resolved taken, I5,I6,I7\text{I}_5, \text{I}_6, \text{I}_7 flushed), I5\text{I}_5 in FO, I6\text{I}_6 in DI, I7\text{I}_7 in FI

    • Cycle 8: I4\text{I}_4 in WO, I9\text{I}_9 in FI (Target fetched)

    • Cycle 9: I9\text{I}_9 in DI, I10\text{I}_{10} in FI

    • Cycle 10: I9\text{I}_9 in FO, I10\text{I}_{10} in DI, I11\text{I}_{11} in FI

    • Cycle 11: I9\text{I}_9 in EI, I10\text{I}_{10} in FO, I11\text{I}_{11} in DI, I12\text{I}_{12} in FI

    • Cycle 12: I9\text{I}_9 in WO, I10\text{I}_{10} in EI, I11\text{I}_{11} in FO, I12\text{I}_{12} in DI

    • Cycle 13: I10\text{I}_{10} in WO, I11\text{I}_{11} in EI, I12\text{I}_{12} in FO

    • Cycle 14: I11\text{I}_{11} in WO, I12\text{I}_{12} in EI

    • Cycle 15: I12\text{I}_{12} in WO (Program completed)

  4. Total Execution Time:

    Total Time=15 cycles×11 ns/cycle=165 ns\text{Total Time} = 15 \text{ cycles} \times 11\text{ ns/cycle} = 165\text{ ns}

Hence, the correct option is (B).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Instruction Pipelining previous year question is Q45 of the GATE CSE 2013 paper. Find more GATE CSE PYQs on Instruction Pipelining in Computer Organization and Architecture, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Instruction Pipelining PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Instruction Pipelining in GATE CSE

Instruction Pipelining has 25 GATE CSE PYQs across 20 papers from 2011 to 2026. 3 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2013.

How GATE tests Instruction Pipelining

More from GATE CSE 2013

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2013 · Q45 · MCQ

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 I9. If the branch is taken during the execution of this program, the time (in ns) needed to complete the program is

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.