Back to the 2014 paper

Module 3: Pipelining

201414m

3. A program runs on a 10 GHz CPU with the instruction mix and corresponding clock cycle count as given in the table:

Instruction type Clock cycle count Instruction count
Control transfer 5 5000
Data transfer 4 4000
Floating point 2 2000
Integer 1 1000

Determine the following:

  • (a) CPI
  • (b) Execution time
  • (c) MIPS rate for program
Worked SolutionAI Assisted

Given Data

Clock f=10f = 10 GHz ⇒Tc=1/f=0.1\Rightarrow T_c = 1/f = 0.1 ns =10−10= 10^{-10} s

Type CPIi_i (cic_i) IiI_i
Control 5 5000
Data transfer 4 4000
Floating 2 2000
Integer 1 1000

Total instructions I=∑Ii=5000+4000+2000+1000=12000I = \sum I_i = 5000+4000+2000+1000 = 12000

Total cycles C=∑ciIiC = \sum c_i I_i

C=5000×5+4000×4+2000×2+1000×1C = 5000\times5 + 4000\times4 + 2000\times2 + 1000\times1
C=25000+16000+4000+1000=46000C = 25000 + 16000 + 4000 + 1000 = 46000 cycles

(a) CPI (Average Clock Cycles per Instruction)

CPI=CI=4600012000=3.833...≈3.83CPI = \dfrac{C}{I} = \dfrac{46000}{12000} = 3.833... \approx 3.83 cycles/instr

If weighted: CPI=∑(Ii/I)×ci=0.4167×5+0.3333×4+0.1667×2+0.0833×1=3.83CPI = \sum (I_i/I)\times c_i = 0.4167\times5 + 0.3333\times4 +0.1667\times2+0.0833\times1 =3.83

(b) Execution Time

Tcpu=C×Tc=CfT_{cpu}= C \times T_c = \dfrac{C}{f}

Tcpu=4600010×109=4.6×10−6T_{cpu}= \dfrac{46000}{10\times10^9}= 4.6\times10^{-6} s =4.6μs= 4.6 \mu s

Alternatively Tcpu=I×CPI×Tc=12000×3.833×0.1ns=4600nsT_{cpu}= I \times CPI \times T_c =12000\times3.833\times0.1ns =4600 ns

Tcpu=4.6μsT_{cpu}=4.6 \mu s (if f=1GHzf=1GHz, 46μs46 \mu s)

(c) MIPS Rate

MIPS=ITcpu×106=fCPI×106MIPS = \dfrac{I}{T_{cpu}\times10^6} = \dfrac{f}{CPI\times10^6}

MIPS=10×1093.833×106=2608.7MIPS = \dfrac{10\times10^9}{3.833\times10^6}= 2608.7

≈2609 \approx 2609 MIPS ≈2.61×103\approx 2.61\times10^3 MIPS =2.61=2.61 BIPS

Check: MIPS=12000/(4.6×10−6×106)=12000/4.6=2608.7MIPS =12000/(4.6\times10^{-6}\times10^6)=12000/4.6=2608.7

If using MIPS = I/(T in μs\mu s) same result.

Summary: CPI ≈3.83\approx 3.83, T≈4.6μsT \approx 4.6 \mu s at 10GHz (46μs46 \mu s at 1GHz), ~2609 MIPS.

Similar questions

Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.