The Classic Five-Stage Pipeline
What you'll learn: You'll discover the five standard stages that break instruction execution into a streamlined assembly line inside the CPU.
What Is the Five-Stage Pipeline?
Building on the instruction cycle you've learned, pipelining divides instruction execution into five distinct stages that work simultaneously on different instructions. Instead of waiting for one instruction to finish completely before starting the next, the CPU overlaps them—like an assembly line in a factory.
The Five Stages
1. Instruction Fetch (IF)
The CPU retrieves the next instruction from memory using the Program Counter (PC). This is identical to the Fetch Stage you've studied.
2. Instruction Decode (ID)
The fetched instruction is decoded—the Control Unit interprets the opcode, identifies operands, and reads from the Register File if needed.
3. Execute (EX)
The ALU performs the actual operation: arithmetic, logic, or address calculation. For example, ADD R1, R2, R3 would compute the sum here.
4. Memory Access (MEM)
If the instruction requires memory interaction (LOAD or STORE), the CPU accesses main memory now. Non-memory instructions skip this stage.
5. Write-Back (WB)
Results are written back to the destination register. For ADD R1, R2, R3, the sum is stored in R1 here.
The Assembly Line Analogy
Think of building toy cars: one station fetches parts, another assembles the body, another paints, another adds wheels, and the last inspects. While Station 5 finishes Car #1, Station 4 works on Car #2, Station 3 on Car #3, and so on—all simultaneously.
Key Takeaway: The classic five-stage pipeline—Fetch, Decode, Execute, Memory, Write-Back—breaks instruction execution into overlapping stages, allowing the CPU to work on multiple instructions at once and dramatically improve throughput.