Skip to content
Official PYQ · 2020

GATE CS 2020 Q43 — Instruction Pipelining

Explain with AI
Consider a non-pipelined processor operating at 2.52.5 GHz. It takes 55 clock cycles to complete an instruction. You are going to make a 55- stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at 22 GHz. In a given program, assume that 30%30\% are memory instructions, 60%60 \% are ALU instructions and the rest are branch instructions. 5%5 \% of the memory instructions cause stalls of 5050 clock cycles each due to cache misses and 50%50 \% of the branch instructions cause stalls of 22 cycles each. Assume that there are no stalls associated with the execution of ALU instructions. For this program, the speedup achieved by the pipelined processor over the non-pipelined processor (round off to 22 decimal places) is_____________.
View worked solution

Answer: 2.15:2.18

To find the speedup achieved by the pipelined processor over the non-pipelined processor, we compare the average execution time per instruction for both cases.

1. Non-Pipelined Processor

  • Frequency (fnpf_{\text{np}}): 2.5 GHz2.5\text{ GHz}
  • Clock cycle time (tnpt_{\text{np}}): 12.5 GHz=0.4 ns\frac{1}{2.5\text{ GHz}} = 0.4\text{ ns}
  • Cycles per instruction (CPInpCPI_{\text{np}}): 55

Average execution time per instruction (TnpT_{\text{np}}):

Tnp=CPInp×tnp=5×0.4 ns=2.0 nsT_{\text{np}} = CPI_{\text{np}} \times t_{\text{np}} = 5 \times 0.4\text{ ns} = 2.0\text{ ns}

2. Pipelined Processor

  • Frequency (fpf_{\text{p}}): 2 GHz2\text{ GHz}
  • Clock cycle time (tpt_{\text{p}}): 12 GHz=0.5 ns\frac{1}{2\text{ GHz}} = 0.5\text{ ns}
  • Ideal CPI: 11

Instruction Mix and Stalls:

  • Memory Instructions (30%30\% of total):

    5%5\% of these cause 5050 stall cycles each.

    Average memory stalls per instruction=0.30×0.05×50=0.75 cycles\text{Average memory stalls per instruction} = 0.30 \times 0.05 \times 50 = 0.75\text{ cycles}
  • Branch Instructions (10%10\% of total, since 100%−30%−60%=10%100\% - 30\% - 60\% = 10\%):

    50%50\% of these cause 22 stall cycles each.

    Average branch stalls per instruction=0.10×0.50×2=0.10 cycles\text{Average branch stalls per instruction} = 0.10 \times 0.50 \times 2 = 0.10\text{ cycles}
  • ALU Instructions (60%60\% of total):

    These cause 00 stalls.

Average CPI of the Pipelined Processor (CPIpCPI_{\text{p}}):

CPIp=Ideal CPI+Average Stalls per InstructionCPI_{\text{p}} = \text{Ideal CPI} + \text{Average Stalls per Instruction} CPIp=1+0.75+0.10=1.85 cyclesCPI_{\text{p}} = 1 + 0.75 + 0.10 = 1.85\text{ cycles}

Average execution time per instruction (TpT_{\text{p}}):

Tp=CPIp×tp=1.85×0.5 ns=0.925 nsT_{\text{p}} = CPI_{\text{p}} \times t_{\text{p}} = 1.85 \times 0.5\text{ ns} = 0.925\text{ ns}

3. Speedup Calculation

Speedup=TnpTp=2.0 ns0.925 ns≈2.162\text{Speedup} = \frac{T_{\text{np}}}{T_{\text{p}}} = \frac{2.0\text{ ns}}{0.925\text{ ns}} \approx 2.162

Rounding off to two decimal places, the speedup is 2.16.

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

Published
Report a correction
Keep exploringMore Instruction Pipelining questions