Back to the 2022 paper

Module 3: Pipelining

202214m

A non-pipelined processor has a clock rate of 2.52.5 GHz and an average CPI (cycles per instruction) of 44. An upgrade to the processor introduces a five-stage pipeline. However, due to internal pipeline delays, such as latch delay, the clock rate of the new processor has to be reduced to 22 GHz.

(a) What is the speedup achieved for a typical program?

(b) What is the MIPS rate for each processor?

Worked SolutionAI Assisted

(a) Speedup

Let NN = no. of instructions.

Non-pipelined:

  • Clock fnp=2.5 GHz⇒Tnp=0.4 nsf_{np}=2.5\text{ GHz} \Rightarrow T_{np}=0.4\text{ ns}
  • CPInp=4CPI_{np}=4
  • Told=N⋅CPInp⋅Tnp=N⋅4/fnp=N⋅1.6 nsT_{old}= N\cdot CPI_{np}\cdot T_{np}= N\cdot 4 / f_{np}= N\cdot 1.6\text{ ns}

Time per instruction =1.6 ns= 1.6\text{ ns}.

Pipelined (5-stage, ideal, no hazards):

  • fp=2.0 GHz⇒Tp=0.5 nsf_{p}=2.0\text{ GHz} \Rightarrow T_{p}=0.5\text{ ns}
  • Ideal CPIp=1CPI_{p}=1 (one instruction completes per cycle in steady state). Ignoring fill/drain overhead for large NN: Tnew=N⋅1⋅Tp=N⋅0.5 nsT_{new}= N\cdot 1 \cdot T_{p}= N\cdot 0.5\text{ ns}.

With fill overhead: Tnew=(k+N−1)TpT_{new}= (k+N-1)T_{p} where k=5k=5, ≈NTp\approx N T_{p} for N≫kN\gg k.

Speedup=ToldTnew=CPInp/fnpCPIp/fp=4/2.51/2=1.60.5=3.2Speedup = \frac{T_{old}}{T_{new}} = \frac{CPI_{np}/f_{np}}{CPI_{p}/f_{p}} = \frac{4/2.5}{1/2}= \frac{1.6}{0.5}=3.2

So ≈3.2×\approx 3.2\times speedup in the ideal hazard-free case. If pipeline stalls/hazards raise CPIpCPI_{p} to e.g. 1.2 then Speedup=(4/2.5)/(1.2/2)=2.67Speedup = (4/2.5)/(1.2/2)=2.67.

Maximum theoretical speedup ignoring clock reduction: CPInp/CPIp=4CPI_{np}/CPI_{p}=4; with clock penalty 2/2.5=0.82/2.5=0.8, net 4×0.8=3.24\times0.8=3.2.

(b) MIPS rate

MIPS=fCPI×106MIPS = \frac{f}{CPI\times10^{6}}

  • Non-pipelined: MIPSnp=2.5×1094×106=625 MIPSMIPS_{np}= \dfrac{2.5\times10^{9}}{4\times10^{6}} = \mathbf{625\ MIPS}

  • Pipelined (ideal CPI=1CPI=1): MIPSp=2.0×1091×106=2000 MIPSMIPS_{p}= \dfrac{2.0\times10^{9}}{1\times10^{6}} = \mathbf{2000\ MIPS}

If hazards included, e.g. CPIp=1.14CPI_{p}=1.14, MIPSp≈1754MIPS_{p}\approx 1754. In general MIPSp=2000/CPIpMIPS_{p}=2000/CPI_{p}.

Throughput gain =2000/625=3.2=2000/625=3.2 same as speedup.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.