Computer Architecture Pipe Line
Computer Architecture Pipe Line
Overview
Pipelining is widely used in modern processors.
Use faster circuit technology to build the processor and the main memory.
Arrange the hardware so that more than one operation can be performed at the
same time.
In the latter way, the number of operations performed per second is increased
even though the elapsed time needed to perform any one operation is not
changed.
Pipeline
It is technique of decomposing a sequential process into suboperation,
with each suboperation completed in dedicated segment.
6 PM 7 8 9 10 11 Midnight
Time
30 40 20 30 40 20 30 40 20 30 40 20
Sequential laundry takes 6
A
hours for 4 loads
If they learned pipelining,
B how long wouldlaundry
take?
C
D
Pipelined Laundry
6 PM 7 8 9 10 11 Midnight
Time
T
a 30 40 40 40 40 20
s
k A
Pipelined laundry takes
3.5 hours for 4 loads
O B
r
d C
e
D
r
Traditional Pipeline Concept
Pipelining doesn’t help
6 PM latency of single task, it
7 8 9
helps throughput of entire
Time
workload
T
a 30 40 40 40 40 20 Pipeline rate limited by
slowest pipeline stage
s
A Multiple tasks operating
k
simultaneously using
different resources
O B Potential speedup = Number
r pipe stages
d Unbalanced lengths of pipe
C
e stages reduces speedup
r Time to “fill” pipeline and
D
time to “drain” it reduces
speedup
Stall for Dependences
Idea of pipelining in computer
The processor execute the program by fetching and executing instructions.
One after the other.
Let Fi and Ei refer to the fetch and execute steps for instruction Ii
Use the Idea of Pipelining in a Computer
Fetch + Execution
I1 I2 I3 T ime
Time
Clock cycle 1 2 3 4
F1 E1 F2 E 2 F3 E3
Instruction
I2 F2 E2
Interstage buffer
B1
I3 F3 E3
Instruction
fetch Execution (c) Pipelined execution
unit unit
This buffer needed to enable the execution unit while fetch unit
fetching the next instruction.
The computer is controlled by a clock.
Any instruction fetch and execute steps completed in one clock cycle.
Definition:
Pipelining is an speed up technique where multiple
instructions are overlapped in execution on a
processor.
Pipelining: Processors
CS211 9
Decode Instruction
• The DI stage is responsible for decoding the instruction and sending out the
various control lines to the other parts of the processor.
CS211 10
Calculate Operands
CS211 11
Fetch Operands and Execute Instruction
• The FO and EI stages are responsible for storing and loading values to and
from memory. They also responsible for input and output from the processor
respectively.
CS211 12
Write Operands
• The WO stage is responsible for writing the result of a calculation, memory
access or input into the register file.
CS211 13
Six Stage
Instruction
Pipeline
Use the Idea of Pipelining in a Computer
Time
Clock cycle 1 2 3 4 5 6 7
Instruction
Fetch + Decode I1 F1 D1 E1 W1
+ Execution + Write I2 F2 D2 E2 W2
I3 F3 D3 E3 W3
I4 F4 D4 E4 W4
Interstage buffers
D : Decode
F : Fetch E: Execute W : Write
instruction instruction and fetch operation results
operands
B1 B2 B3
Si S
i+1
τ τm d
Latch delay : d
τ = max {τm } + d
Pipeline frequency : f
f=1/τ CS211 16
7
k cycles for the first task and n-1 cycles for the remaining n-1 tasks
Tk = [ k + (n-1)] τ
T1 = n k τ
T1 nkτ nk
Speedup factor Sk = [ k + (n-1)] τ = k + (n-1)
= Tk
CS211 17
Advantages