Skip to content
Official PYQ · 2017

GATE CS 2017 Set 1 Q50 — Instruction Pipelining

Explain with AI

Instruction execution in a processor is divided into 55 stages, Instruction Fetch (IF), Instruction Decode (ID), Operand fetch (OF), Execute (EX), and Write Back (WB). These stages take 5, 4, 20, 10 and 3 nanoseconds (ns) respectively. A pipelined implementation of the processor requires buffering between each pair of consecutive stages with a delay of 2 ns. Two pipelined implementation of the processor are contemplated:

  1. a naive pipeline implementation (NP) with 55 stages and
  2. an efficient pipeline (EP) where the OF stage is divided into stages OF1\text{OF1} and OF2\text{OF2} with execution times of 12 ns and 8 ns respectively.

The speedup (correct to two decimal places) achieved by EP over NP in executing 2020 independent instructions with no hazards is _________ .

View worked solution

Answer: 1.50 : 1.51

The execution time of a pipeline with kk stages for nn instructions (with no hazards) is given by:

Ttotal=(k+n−1)×tclkT_{\text{total}} = (k + n - 1) \times t_{\text{clk}}

where tclkt_{\text{clk}} is the clock cycle time, determined by the maximum stage delay plus the buffer overhead:

tclk=max⁡(stage delays)+buffer delayt_{\text{clk}} = \max(\text{stage delays}) + \text{buffer delay}

1. Naive Pipeline (NP)

  • Stages (kNPk_{\text{NP}}): 55 (IF, ID, OF, EX, WB)
  • Stage delays: 5,4,20,10,35, 4, 20, 10, 3 ns
  • Buffer delay: 22 ns
  • Clock cycle time (tNPt_{\text{NP}}): tNP=max⁡(5,4,20,10,3)+2=20+2=22 nst_{\text{NP}} = \max(5, 4, 20, 10, 3) + 2 = 20 + 2 = 22 \text{ ns}
  • Total execution time for 2020 instructions (TimeNPTime_{\text{NP}}): TimeNP=(5+20−1)×22=24×22=528 nsTime_{\text{NP}} = (5 + 20 - 1) \times 22 = 24 \times 22 = 528 \text{ ns}

2. Efficient Pipeline (EP)

  • Stages (kEPk_{\text{EP}}): 66 (IF, ID, OF1, OF2, EX, WB)
  • Stage delays: 5,4,12,8,10,35, 4, 12, 8, 10, 3 ns
  • Buffer delay: 22 ns
  • Clock cycle time (tEPt_{\text{EP}}): tEP=max⁡(5,4,12,8,10,3)+2=12+2=14 nst_{\text{EP}} = \max(5, 4, 12, 8, 10, 3) + 2 = 12 + 2 = 14 \text{ ns}
  • Total execution time for 2020 instructions (TimeEPTime_{\text{EP}}): TimeEP=(6+20−1)×14=25×14=350 nsTime_{\text{EP}} = (6 + 20 - 1) \times 14 = 25 \times 14 = 350 \text{ ns}

3. Speedup Calculation

The speedup achieved by EP over NP is:

Speedup=TimeNPTimeEP=528350≈1.50857\text{Speedup} = \frac{Time_{\text{NP}}}{Time_{\text{EP}}} = \frac{528}{350} \approx 1.50857

Rounding to two decimal places, the speedup is 1.51 (or 1.50 depending on the rounding convention used, both are accepted).

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Instruction Pipelining questions