โ Computer Organization & Architecture learning pathComputer Organization & Architecture ยท Module 5 of 10
Pipelining
Overlapping instruction execution.
๐ Key ideas
- A classic 5-stage pipeline: IF (fetch), ID (decode), EX (execute), MEM (memory), WB (write back).
- Ideal speed-up approaches the number of stages, but hazards reduce it.
- Structural hazards: two instructions need the same hardware.
- Data hazards: an instruction needs a result not yet written; fixed by forwarding or stalls.
- Control hazards: branches; handled with prediction and flushing.
๐ก Real-life example: Like a car wash with five bays: once full, a clean car comes out every few minutes even though each wash takes longer.
Pipeline stageOne step of instruction processing
Data hazardDependency on a result not yet available
ForwardingPassing a result directly to a later stage
Branch predictionGuessing the outcome of a branch