Pipelining and Parallel Processing
Pipelining and Parallel Processing
Processing
What is Pipelining?
A way of speeding up execution of
instructions
Key idea:
overlap execution of multiple instructions
What is Pipelining
A technique used in advanced microprocessors
where the microprocessor begins executing a
second instruction before the first has been
completed.
P2 b1 b2 b3 b4 P2 a2 b2 c2 d2
P3 c1 c2 c3 c4 P3 a3 b3 c3 d3
P4 d1 d2 d3 d4 P4 a4 b4 c4 d4
P2 P2
P3 P3
P4 P4
time time
Pipelining a Processor
Recall the 5 steps in instruction
execution:
1. Fetch instruction (FI)
2. Decode instruction (DI)
3. Calculate operands (CO)
4. Fetch operands (FO)
5. Execute instructions (EI)
6. Write result (WR)
•
Timing diagram for instruction
pipeline operation
Advantages/Disadvantages
Advantages:
More efficient use of processor
Quicker time of execution of large number of
instructions
Disadvantages:
Pipelining involves adding hardware to the
chip
Inability to continuously run the pipeline
at full speed because of pipeline hazards
which disrupt the smooth execution of the
pipeline.
Comments about Pipelining
The good news
Multiple instructions are being processed at same time
This works because stages are isolated by registers
STALL IF ID EX M WB
STALL IF ID EX M WB
STALL IF ID EX M WB