Pipelining and ALU
Pipelining and ALU
ALU
Presented By
Abhishek
00811805220
M.Tech VLSI Design
Pipelining and ALU
Introduction Defining
Pipelining Pipelining
Instructions
Hazards
Structurals Hazards
hazards Data
Hazards Control
ALU
combination ALU
What is
Pipelining?
A mechanism for overlapped execution of several input
sets by partitioning some computation into set of k sub-
computations (or stages).
- Very nominal increase in cost of implementation.
- very significant speedup (ideally ,k).
The Laundry Analogy
● A, B, C, D each have one A B C D
load of clothes to wash, dry,
and fold
● Washer takes 30 minutes
●
“Stasher” takes 30 minutes
to put clothes into drawers
If we do laundry
6 PM 7 8
sequentially...
10 11 12 1 2 AM
9
●
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
●
Time
T A
a
s
k B
O
r C
d
e D
r
To Pipeline, We Overlap Tasks
6 PM 7 8 9 10 11 12 1 2 AM
Time
30 30 30 30 30 30 30
• Pipelining doesn’t help latency of single
T task, it helps throughput of entire
a A
workload
s
k B • Multiple tasks operating
simultaneously
O
r C
d
e D
r
12
Pipelining a Digital System
● Key idea: break big computation up into
pieces
1ns
Pipeline
Register
Pipelining a Digital System
Why do this? Because it's faster for repeated
computations
Non-pipelined:
1operationfinishes
every1ns
1ns
Pipelined:
1operationfinishes
every200ps
●
Example of Pipeline Processing
Content of Registers in
Pipeline
Space Time Diagram of Pipeline
Speedup
S p e e d u p f r o m pipeline
●
Where,
●
The speedup then reduces to numer of stages of pipeline
Throughput
Comments about
Pipelining
The good news
- Multiple instructions are being processed at same time
- This works because stages are isolated by registers
- Best case speedup of N
The bad news
- Instructions interfere with each other - hazards
Example: different instructions may need the same piece of
hardware (e.g., memory) in same clock cycle
Example: instruction may require a result produced by an
earlier instruction that is not yet complete
Pipeline Hazards
Limits to pipelining: Hazards prevent next
instruction from executing during its designated
clock cycle
Structural hazards: two different instructions use same h/w in same cycle
Data hazards: Instruction depends on result of prior instruction still in the
pipeline
Control hazards: Pipelining of branches & other instructions that change the PC
ALU
• An arithmetic-logic unit (ALU) is the part of a
computer processor (CPU) that carries out arithmetic and logic
operations on the operands in computer instruction words. In some
processors, the ALU is divided into two units, an arithmetic unit (AU)
and a logic unit (LU). Some processors contain more than one AU -
for example, one for fixed-point operations and another for floating-
point operations.
Combinational ALU
Sub unit 2 i.e logic unit