CPU Performance: CPI, Execution Time, and MIPS from an Instruction Mix

CPU Performance: CPI, Execution Time, and MIPS from an Instruction Mix

Verified Sources
Nov 3, 2026

To analyze CPU performance from an instruction mix, we compute three quantities from the given instruction counts and per-instruction clock-cycle costs: CPI (part a), execution time (part b), and MIPS (part c).

From the table:

  • Control transfer: 5000 instructions × 5 cycles each
  • Data transfer: 4000 instructions × 4 cycles each
  • Floating point: 2000 instructions × 2 cycles each
  • Integer: 1000 instructions × 1 cycle each

We’ll use these to find:

  1. Total instructions executed
  2. Total clock cycles required
  3. Average cycles per instruction (CPI)
  4. Execution time at 10 GHz
  5. MIPS = (instruction count per second) / 10610^6

Compute CPI, Execution Time, and MIPS

  1. 1
    Step 1

    Sum instruction counts: N=5000+4000+2000+1000=12000N=5000+4000+2000+1000=12000.

  2. 2
    Step 2

    Multiply each instruction class by its cycle cost and sum: C=5000⋅5+4000⋅4+2000⋅2+1000⋅1=25000+16000+4000+1000=46000C=5000\cdot5+4000\cdot4+2000\cdot2+1000\cdot1=25000+16000+4000+1000=46000.

  3. 3
    Step 3

    Use CPI=CN=4600012000=3.8333…≈3.83\text{CPI}=\dfrac{C}{N}=\dfrac{46000}{12000}=3.8333\ldots\approx3.83.

  4. 4
    Step 4

    Clock rate f=10 GHz=10×109f=10\text{ GHz}=10\times10^9 cycles/s, so Time=Cf=4600010×109=4.6×10−6 s=4.6 μs\text{Time}=\dfrac{C}{f}=\dfrac{46000}{10\times10^9}=4.6\times10^{-6}\text{ s}=4.6\ \mu\text{s}.

  5. 5
    Step 5

    MIPS is instructions per second106\dfrac{\text{instructions per second}}{10^6}. First, instructions per second =NTime=120004.6×10−6≈2.6087×109=\dfrac{N}{\text{Time}}=\dfrac{12000}{4.6\times10^{-6}}\approx2.6087\times10^9. Then MIPS=2.6087×109106≈2608.7\text{MIPS}=\dfrac{2.6087\times10^9}{10^6}\approx2608.7.

Instruction Mix Contribution to Total Cycles

Each bar shows total cycles contributed by that instruction type.

Pro Tip: CPI is a weighted average

CPI is not the simple average of the cycle counts; it is the instruction-count-weighted average: CPI=∑i(Ii⋅Ci)∑iIi\text{CPI}=\dfrac{\sum_i (I_i\cdot C_i)}{\sum_i I_i}.

Watch units for execution time and MIPS

For a 10 GHz CPU, convert to cycles/s: 10 GHz=10×109 cycles/s10\text{ GHz}=10\times10^9\ \text{cycles/s}. For MIPS, divide instruction rate by 10610^6.

Final Answers

(a) CPI

textCPI=frac4600012000=3.8333ldotsapprox3.83\\text{CPI}=\\frac{46000}{12000}=3.8333\\ldots\\approx 3.83

(b) Execution time
Clock rate: f=10textGHz=10times109textcycles/sf=10\\text{ GHz}=10\\times10^9\\ \\text{cycles/s}

textTime=frac4600010times109=4.6times10−6texts=4.6mutexts\\text{Time}=\\frac{46000}{10\\times10^9}=4.6\\times10^{-6}\\text{ s}=4.6\\ \\mu\\text{s}

(c) MIPS rate for the program

textInstructionspersecond=frac120004.6times10−6approx2.6087times109\\text{Instructions per second}=\\frac{12000}{4.6\\times10^{-6}}\\approx2.6087\\times10^9 textMIPS=frac2.6087times109106approx2608.7textMIPS\\text{MIPS}=\\frac{2.6087\\times10^9}{10^6}\\approx2608.7\\ \\text{MIPS}

Common Checks

Knowledge Check

Question 1 of 4
Q1Single choice

Given total cycles C=46000C=46000 and total instructions N=12000N=12000, what is CPI?