CPU Organization and Pipeline

Pipelining overlaps instruction phases to improve throughput while keeping stage work balanced.

Key formulas & points

Skim these first — then read the full notes below.

  • Forwarding bypasses EX/MEM result to EX
  • Branch prediction reduces control hazard flush
  • Superscalar issues multiple instructions per cycle

Topic details

Introduction

Patterson and Hennessy present the classic 5-stage pipeline that appears directly in Indian architecture papers. Questions usually ask hazard handling and cycle-by-cycle timing.

Key relations & formulas

Formulas (Indian textbook notation)

  • 5stage:IFtoIDtoEXtoMEMtoWB5-stage: IF to ID to EX to MEM to WB

Formulas (Indian textbook notation)

  • speedupstages(1+stallfraction×penalty)speedup \approx \frac{stages}{(1 + stall_{fraction} \times penalty)}

Formulas (Indian textbook notation)

  • hazard:structural,data(RAWWAR/WAW),controlhazard: structural, data (\frac{RAW}{WAR}/WAW), control

Notation and sign conventions

Relation 1 —
5stage:IFtoIDtoEXtoMEMtoWB5-stage: IF to ID to EX to MEM to WB

Formulas (Indian textbook notation)

  • 5stage:IFtoIDtoEXtoMEMtoWB5-stage: IF to ID to EX to MEM to WB
Write this relation with symbols exactly as in Computer System Architecture — Morris Mano before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.
Relation 2 —
speedupstages/speedup \approx stages /

Formulas (Indian textbook notation)

  • speedupstages(1+stallfraction×penalty)speedup \approx \frac{stages}{(1 + stall_{fraction} \times penalty)}
Write this relation with symbols exactly as in Computer System Architecture — Morris Mano before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.
Relation 3 —
hazard:structural,datahazard: structural, data

Formulas (Indian textbook notation)

  • hazard:structural,data(RAWWAR/WAW),controlhazard: structural, data (\frac{RAW}{WAR}/WAW), control
Write this relation with symbols exactly as in Computer System Architecture — Morris Mano before substituting numbers. Examiners award partial marks for a correct setup even when arithmetic slips.

Concept in depth

A pipeline increases instruction throughput by dividing execution into stages. Real performance depends on hazards and stall frequency, not ideal stage count alone. Data hazards are reduced via forwarding and interlocks, while control hazards use prediction and speculative execution. Structural hazards require resource duplication or careful scheduling.

Assumptions and validity limits

State assumptions explicitly before using any relation for cpu organization and pipeline — steady state, uniform properties, linear elastic material, ideal gas, incompressible flow, etc., as applicable.
Wrong assumptions invalidate the entire solution even when the formula is correct. In Computer Architecture viva and GATE descriptive questions, listing valid assumptions often earns separate marks.

Step-by-step problem approach

1. Read the question and list given data with SI units (common in Computer Architecture papers).
2. Draw a neat labelled diagram where applicable — examiners in Indian universities award diagram marks even when arithmetic slips.
3. Identify which relation from this topic applies to cpu organization and pipeline.
4. Use equation 1:
5stage:IFtoIDtoEXtoMEMtoWB5-stage: IF to ID to EX to MEM to WB
.
5. Use equation 2:
speedupstages/speedup \approx stages /
.
6. Substitute values, compute, and verify units and sign (direction).
7. State conclusion in one line — e.g. safe/unsafe, stable/unstable, feasible/infeasible.

Applications & exam relevance

CPU Organization and Pipeline appears in processor and system design. In Indian computer hardware curricula this topic is tested because it connects theory to CPU, memory hierarchy, and I/O.
GATE and semester exams often combine cpu organization and pipeline with earlier units — revise prerequisites before attempting mixed problems.
Industry interview panels sometimes ask: "Where did you use cpu organization and pipeline?" — answer with a lab, mini-project, or plant visit example if possible.

Common mistakes in exams

Students often compute speedup as number of stages without adding fill/drain and stall cycles. Another common error is misclassifying control hazards as data hazards in timeline diagrams.

Quick revision checklist

Before attempting cpu organization and pipeline problems, confirm you can:
1. Forwarding bypasses EX/MEM result to EX
2. Branch prediction reduces control hazard flush
3. Superscalar issues multiple instructions per cycle
Revise the solved examples in Computer System Architecture — Morris Mano and one previous-year GATE or university paper for this unit.

Worked examples

Try the problem first — open the solution when you are ready to check.

Pipeline speedup with stalls

Problem

A 5-stage pipeline has stall fraction 0.2 and each stall costs 1 extra cycle. Estimate speedup.

Solution

Speedup ≈ 5 / (1 + 0.2×1) = 5 / 1.2 ≈ 4.17.

Conceptual check — CPU Organization and Pipeline

Problem

In a Computer Architecture semester or GATE paper you are asked: "State the main assumption, the governing relation, and one practical consequence of cpu organization and pipeline." What should a complete answer include?

📖 Standard books (India)

  • Computer System ArchitectureMorris Mano

    Read: Syllabus unit

    CPU, memory hierarchy, and I/O