A five-stage pipeline overlaps fetch, decode, execute, memory and writeback. Once the pipe is full, one instruction completes per cycle while each takes five cycles to emerge.
Stage | Work | Hands to the next stage |
|---|---|---|
IF | Fetch the next instruction at PC | Instruction word and PC |
ID | Decode and read source registers | Operands, immediates and control |
EX | ALU work and branch compare | Result or target plus control |
MEM | Load and store to memory | Loaded data or store status |
WB | Write the result to the register file | Retired instruction, nothing further |
Lesson | Covers |
|---|---|
What each stage holds and how valid and kill stay aligned. | |
Splitting delay across stages and the frequency-latency trade. | |
CPI stacks and the IPC-times-frequency test for any change. | |
Structural, data and control hazards with stall arithmetic. | |
Bypass paths, youngest-wins select and the load-use bubble. |
Barely. Throughput scales with 1.07 x 0.94 = 1.01, about a 1 percent gain. The CPI lesson shows the full check.