Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Architecture Metrics Reference
  • Workload Taxonomy for Architects
  • Architecture Glossary
  • Computer Architecture Cheatsheet
  • Pipeline Fundamentals14
    • Pipeline Throughput
      • The Five-Stage Datapath
      • Stage Depth and Clock Period
      • CPI and Speedup Arithmetic
      • Hazard Classes: Structural, Data and Control
      • Forwarding and Stalls
    • Branch Prediction and Fetch
    • Out-of-Order Superscalar Execution
  • Memory Hierarchy15
  • NoC and Interconnect Architecture6
  • Coherency and Memory Ordering9
  • Performance Analysis9
  • Accelerator Architectures6
  • SoC Architecture Tradeoffs9
  • Architecture Interview Prep14
Loading lesson

‹Pipeline Throughput
  1. Topics
  2. Computer Architecture
  3. Pipeline Fundamentals
  4. Pipeline Throughput
  5. CPI and Speedup Arithmetic

Computer Architecture · All levels

CPI and Speedup Arithmetic

CPI, CPI stacks and the speedup arithmetic that decides whether a deeper pipeline wins.

On this page

    CPI, IPC and execution time

    CPI is cycles per instruction and IPC is its inverse. Execution time follows from instruction count, CPI and frequency.

    CPI=IPC1​Texec​=fI×CPI​throughput=IPC×f
    Diagram
    Assume I = 1.0 x 10^9 instructions, CPI = 1.45, f = 3.0 GHz
    T_exec = 10^9 x 1.45 / (3.0 x 10^9 Hz) = 1.45 / 3.0 s = 0.483 s, about 0.48 s

    Stacks add

    Stall sources add onto a base CPI. Each component is measured per instruction, so the parts sum to the total.

    Component

    Cycles per instruction

    Share

    Base

    1.00

    69%

    Frontend stalls

    0.25

    17%

    Control (branch recovery)

    0.20

    14%

    Total CPI

    1.45

    100%

    Diagram
    CPI = 1.00 + 0.25 + 0.20 = 1.45 cycles per instruction
    shares: 1.00/1.45 = 69%, 0.25/1.45 = 17%, 0.20/1.45 = 14% (rounded, sums to 100%)

    Speedup decides

    A repartition changes frequency and CPI together. Speedup is the ratio of IPC-times-frequency products, which is the throughput ratio.

    speedup=IPCbefore​×fbefore​IPCafter​×fafter​​

    Before

    After

    Frequency

    2.60 GHz

    2.79 GHz (+7.3%)

    IPC

    1.84

    1.73 (-6.0%)

    Throughput (GIPS)

    4.78

    4.83

    Diagram
    Assume the stated example parameters: f 2.60 -> 2.79 GHz, IPC 1.84 -> 1.73
    GIPS_before = 1.84 x 2.60 = 4.784
    GIPS_after  = 1.73 x 2.79 = 4.8267, about 4.83
    speedup = 4.8267 / 4.784 = 1.009, about +0.9%: near break-even
    CPI: 1/1.84 = 0.543 -> 1/1.73 = 0.578, a +0.035 cycle-per-instruction regression

    The frequency gain was eaten by higher stall and recovery cost. Without this ratio, either number alone misleads.

    Common pitfall

    Quoting total CPI without decomposition hides the mechanism. A frontend share that rises while memory pressure stays flat points at fetch and recovery, not at the memory system.

    Interview

    Likely probe: the first sign that a repartition harmed the frontend. Rising fetch and decode stall share with unchanged memory pressure, plus queue underfill and extra flush waste. The shared debug method lives with the performance method.

    Check yourself A core retires IPC 2.0 on a workload. What is its CPI?

    CPI = 1/2.0 = 0.50 cycles per instruction.

    Check yourself A program has 2.0 x 10^9 instructions at CPI 1.2 on a 3 GHz core. How long does it run?

    T = 2.0 x 10^9 x 1.2 / 3.0 x 10^9 = 0.80 s.

    Related topics

    • Performance method

    • Roofline and tuning

    Previous

    7 / 86

    Next: Hazard Classes: Structural, Data and Control

    Up next

    Up nextHazard Classes: Structural, Data and Control

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • The Five-Stage Datapath
    • Forwarding and Stalls