5.2.3 · D1Processor Datapath & Pipelining

Foundations — Classic 5-stage pipeline (IF - ID - EX - MEM - WB)

1,896 words9 min readBack to topic

Before you can read the parent note Classic 5-stage pipeline, you must own every word and symbol it throws at you. Below, each item gives plain meaning → the picture → why the topic needs it, ordered so each rests on the ones above.


1. What is an "instruction"?

We need this because pipelining is about how many instructions we can push through per second — so "instruction" is our unit of counting.


2. The sub-steps of one instruction (why five?)

Look at the figure: the five coloured blocks are the phases in order. The arrows show the forced order — each block needs what the previous one produced. That forced order is why there are stages at all, and why they line up in a chain.

You need these five names memorised because the parent note refers to them constantly; here we only fix the labels and order, not the internal wiring.


3. The clock and one "cycle"

In the figure, the ↑ marks are rising edges. We need the clock because pipelining works only if all stages advance in lockstep — one shared drumbeat. See Clocking & Latch Overhead for what the tick physically costs.


4. The symbol — how long one tick lasts

is the pipeline's pace. A smaller = faster ticks = more instructions per second. The parent note's whole timing section is about computing this number.


5. Stage delays , the max, and latch overhead

The bar chart shows five stage delays. The red dashed line sits at the tallest bar — that height is , and every bar shorter than it is wasted slack (that stage sits idle waiting for the tick). This picture is why "unbalanced stages" hurt.

We need because it is why infinite stages don't give infinite speedup — the topic's key limitation. More in Clocking & Latch Overhead.


6. Pipeline registers (the trays between stages)

Because five stages run at once on five different instructions, without these trays the data of instruction A and instruction B would smear together. That is the mistake pipeline registers prevent.


7. , , and the counting formulas

The diagonal chart is the classic pipeline diagram: rows are instructions, columns are ticks. The staircase shows the fill (first result at column ), then one instruction finishes per column. Count the columns used and you see .


Prerequisite map

Instruction = one command

Five sub-steps IF ID EX MEM WB

Clock = shared metronome

Tclk = one tick length

Stage delay ti

max ti = slowest stage

Latch overhead d

Tclk = max ti plus d

Pipeline registers hold between-stage data

cycles = k plus N minus 1

Speedup approaches k

Classic 5-stage pipeline

The map reads bottom-right: instructions become stages, the clock sets the pace, the max plus sets , registers separate instructions, and the counting gives speedup — all feeding the parent topic Classic 5-stage pipeline.


Equipment checklist

Test yourself — you should be able to answer each before reading the parent note.

What is an instruction, and why do we count instructions here?
One small CPU command (add/load/store); it is our unit for measuring throughput (instructions per second).
Name the five stages in order.
IF (fetch), ID (decode/read), EX (execute), MEM (memory), WB (write back).
What is a clock cycle and what happens on its rising edge?
The time between two ticks; on the rising edge every stage hands its half-done work to the next stage in lockstep.
What does stand for and in what units?
The duration of one clock cycle, in ns or ps (1 ns = 1000 ps).
What does mean and why the max?
The largest stage delay; the tick must fit even the slowest stage since all stages share one clock.
What is the latch overhead ?
Small fixed time each cycle for a pipeline register to reliably capture its value; .
What is a pipeline register (a tray) for?
To hold one instruction's between-stage data/control so stages running on different instructions don't smear together.
What do and mean?
= number of instructions; = number of stages.
How many cycles for instructions in a -stage pipe (no stalls)?
to fill, then one finishes per tick.
What does ideal speedup approach as , and why?
; the fill cost becomes negligible, leaving at most a -fold overlap.