โ† Computer Organization & Architecture learning path
Computer Organization & Architecture ยท Module 5 of 10

Pipelining

Overlapping instruction execution.

๐Ÿ“– Key ideas

  1. A classic 5-stage pipeline: IF (fetch), ID (decode), EX (execute), MEM (memory), WB (write back).
  2. Ideal speed-up approaches the number of stages, but hazards reduce it.
  3. Structural hazards: two instructions need the same hardware.
  4. Data hazards: an instruction needs a result not yet written; fixed by forwarding or stalls.
  5. 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