Professional Documents
Culture Documents
08 ECE612 S14 Adders
08 ECE612 S14 Adders
08 ECE612 S14 Adders
S. A. Ibrahim
Ain Shams University
ICL
Outline
Introduction to Datapath
Single-bit Addition
Carry-Ripple Adder
Carry-Bypass Adder
Carry-Select Adder
Carry-Lookahead Adder
Tree Adder
S. Ibrahim
2
Design Abstraction Levels
S. Ibrahim
3
A Generic Digital Processor
MEMORY
INPUT-OUTPUT
CONTROL
DATAPATH
Arithmetic Unit
Adders, shifter, multipliers, ..etc.
Memory
RAM, ROM, Buffers, Shift Registers, ..etc.
Control
Finite State Machines, Counters, ..etc.
Input-Output
S. Ibrahim
4
Bit-Sliced Design
Control
Bit 3
Data-Out
Mul tipl exer
Bit 2
Data-In
Register
A dder
Shi fter
Bit 1
Bit 0
S. Ibrahim
5
Single-Bit Addition
A B A B
Half Adder Full Adder
𝑆 = 𝐴⨁𝐵 Cout 𝑆 = 𝐴⨁𝐵⨁𝐶 Cout C
𝐶𝑜𝑢𝑡 = 𝐴𝐵 𝐶𝑜𝑢𝑡 = 𝐴𝐵 + 𝐴𝐶 + 𝐵𝐶
S S
(Majority Gate)
A B Cout S A B C Cout S
0 0 0 0 0 0 0 0 0
0 1 0 1 0 0 1 0 1
1 0 0 1 0 1 0 0 1
1 1 1 0 0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
S. Ibrahim
6
Carry-Ripple Adder
Simplest design: cascade full adders
Critical path goes from Cin to Cout
Design full adder to have fast carry delay
A3 B3 A2 B2 A1 B1 A0 B0
Cout Cin
C2 C1 C0
S3 delay linear
Worst case S2 with the
S1 number S
of0 bits t = O(N)
d
S. Ibrahim
7
Full Adder Design I
Brute force implementation from eqns
𝑆 = 𝐴⨁𝐵⨁𝐶
𝐶𝑜𝑢𝑡 = 𝐴𝐵 + 𝐴𝐶 + 𝐵𝐶 (Majority)
A A B B C C
A A
B B
B
C C
A B B
S
C C C A
Cout
B
B B C A
A B B
A A
32 Transistors
S. Ibrahim
8
Full Adder Design II
Factor S in terms of Cout
𝑆 = 𝐴𝐵𝐶 + (𝐴 + 𝐵 + 𝐶)𝐶𝑜𝑢𝑡
Critical path is usually C to Cout in ripple adder
VDD
VDD
C A B
A B
A
B
C B
VDD
A
X
C
C A S
C
A B B VDD
A B C A
Co B
28 Transistors
S. Ibrahim
9
Inversion Property
A B A B
Ci FA Co Ci FA Co
S S
S A B C i = S A B Ci
C o A B C i = Co A B Ci
S. Ibrahim
10
Using Inversions
Critical path passes through majority gate
Built from minority + inverter
Eliminate inverter and use inverting full adder
This reduces critical path delay
A3 B3 A2 B2 A1 B1 A0 B0
Cout Cin
C2 C1 C0
S3 S2 S1 S0
S. Ibrahim
11
PGD
For a full adder, define what happens to carries in
terms of A and B
Propagate:
Cout = C
P=𝐴⊕𝐵 A B C Cout S PGD
0 0 0 0 0 D
Generate:
0 0 1 0 1 D
Cout = 1 independent of C
0 1 0 0 1 P
G = 𝐴. 𝐵 0 1 1 1 0 P
Delete: 1 0 0 0 1 P
Cout = 0 independent of C 1 0 1 1 0 P
D = 𝐴 .𝐵 1 1 0 1 0 G
𝐶𝑜𝑢𝑡 = 𝐺 + 𝑃𝐶 1 1 1 1 1 G
𝑆 = 𝑃⨁𝐶
S. Ibrahim
12
Full Adder Design III: The Mirror Adder
VDD
VDD VDD A
A B B A B C B
Delete
"0"-Propagate A C
Co
C S
A C
"1"-Propagate Generate
A B B A B C A
P=𝐴+𝐵 24 transistors
Used here.
S. Ibrahim
13
Advantages of the Mirror Adder
The NMOS and PMOS chains are completely symmetrical.
A maximum of two series transistors can be observed in the carry-
generation circuitry.
When laying out the cell, the most critical issue is the minimization
of the capacitance at node Co. The reduction of the diffusion
capacitances is particularly important.
The capacitance at node Co is composed of four diffusion
capacitances, two internal gate capacitances, and six gate
capacitances in the connecting adder cell.
The transistors connected to C are placed closest to the output.
Only the transistors in the carry stage have to be optimized for
optimal speed. All transistors in the sum stage can be minimal
size.
S. Ibrahim
14
Full Adder Design IV
Complementary Pass Transistor Logic (CPL)
Slightly faster, but more area
B C B C
A
B C B C
S Cout
A
B C B C
A
B C B C
S Cout
B
A
34 Transistors
17: Adders
15
Full Adder Design V
Dual-rail domino
Very fast, but large and power hungry
Used in very fast multipliers
Cout _h Cout _l
C_h A_h C_l A_l
A_h B_h B_h A_l B_l B_l
S_l S_h
C_l
C_h C_h
B_l
B_h B_h
A_h A_l
38 Transistors
17: Adders
16
Full Adder Design VI: TG FA
P
P=𝐴⊕𝐵
VDD
VDD Ci 𝑆 = 𝑃⨁𝐶
A
P S Sum Generation
A A P Ci
A P VDD
B B
VDD A
P
P Co Carry Generation
Ci Ci Ci
A
Setup P
Remember
G = 𝐴. 𝐵 = 𝐴𝑃
𝐶𝑜𝑢𝑡 = 𝐺 + 𝑃𝐶
24 Transistors
S. Ibrahim
17
Manchester Carry Chain
VDD
Pi
VDD
Pi
Ci Co
Gi
Co Gi
Ci
Di
Pi
𝐶𝑜𝑢𝑡 = 𝐺 + 𝑃𝐶
S. Ibrahim
18
Manchester Carry Chain
VDD
P0 P1 P2 P3
C3
Ci,0
G0 G1 G2 G3
C0 C1 C2 C3
𝐺𝑖 = 𝐴𝑖 𝐵𝑖
𝑃𝑖 = 𝐴𝑖 ⊕ 𝐵𝑖
S. Ibrahim
19
Carry-Bypass Adder (1)
Also called
P0 G0 P1 G1 P2 G2 P3 G3 Carry-Skip
Ci,0 C o,0 C o,1 Co,2 Co,3
FA FA FA FA
P0 G0 P1 G1 P2 G2 P3 G3
BP=P oP1 P2 P3
Ci,0 C o,0 Co,1 C o,2
Mul tiplexer
FA FA FA FA
Co,3
S. Ibrahim
20
Carry-Bypass Adder (2)
M bits
S. Ibrahim
21
Carry Ripple versus Carry Bypass
S. Ibrahim
22
Carry-Select Adder
Setup
P,G
Carry Vector
Sum Generation
S. Ibrahim
24
Linear Carry-Select Adder
S. Ibrahim
25
Square Root Carry-Select Adder
M bits
P stages
S. Ibrahim
27
Carry-Lookahead Adder (1)
S. Ibrahim
28
Carry-Lookahead Adder (2)
S. Ibrahim
29
Logarithmic Lookahead
S. Ibrahim
30
Carry-Lookahead Trees
Co 0 = G0 + P0 Ci 0
C o 1 = G1 + P1 G0 + P1 P0 Ci 0
C o 2 = G2 + P2 G1 + P2 P1 G0 + P2 P1 P0 C i 0
= G2 + P2 G1 + P2 P1 G0 + P0 Ci 0 = G 2:1 + P2:1 C o 0
• Base case
𝐺𝑖:𝑖 ≡ 𝐺𝑖 = 𝐴𝑖 𝐵𝑖
𝑃𝑖:𝑖 ≡ 𝑃𝑖 = 𝐴𝑖 ⊕ 𝐵𝑖
• Sum
𝑆𝑖 = 𝑃𝑖 ⊕ 𝐺𝑖−1:0 & 𝑆0 = 𝑃0 ⊕ 𝐶𝑖𝑛
S. Ibrahim
32
Carry-Ripple Revisited
1: Bitwise PG logic
G3 P3 G2 P2 G1 P1 G0 P0
2: Group PG logic
C2 C1 C0
3: Sum logic
C3
Cout S3 S2 S1 S0
S. Ibrahim
33
PG Diagram Notation
Gi:k Gi:k
Gi:j Gi:j
Pi:k Pi:k Gi:j Gi:j
Gk-1:j Gk-1:j
Pi:j Pi:j
Pi:j
Pk-1:j
17: Adders
34
Carry-Ripple PG Diagram
Bit Position
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Delay
15:0 14:0 13:0 12:0 11:0 10:0 9:0 8:0 7:0 6:0 5:0 4:0 3:0 2:0 1:0 0:0
S. Ibrahim
35
Brent-Kung Tree Adder
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15:8 7:0
Critical Path
11:0
15:0 14:0 13:0 12:0 11:0 10:0 9:0 8:0 7:0 6:0 5:0 4:0 3:0 2:0 1:0 0:0
𝑡𝑡𝑟𝑒𝑒 = 𝑡𝑝𝑔 + (2 ∗ 𝑙𝑜𝑔2 (𝑁) −1)𝑡𝐴𝑂 +𝑡𝑋𝑂𝑅
• PG FO < 2 • Wiring Tracks between levels = 1
• Maximum interconnect span = N/2
S. Ibrahim
36
Sklansky Tree Adder
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15:0 14:0 13:0 12:0 11:0 10:0 9:0 8:0 7:0 6:0 5:0 4:0 3:0 2:0 1:0 0:0
S. Ibrahim
37
Kogge-Stone Tree Adder
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15:14 14:13 13:12 12:11 11:10 10:9 9:8 8:7 7:6 6:5 5:4 4:3 3:2 2:1 1:0
15:12 14:11 13:10 12:9 11:8 10:7 9:6 8:5 7:4 6:3 5:2 4:1 3:0 2:0
15:8 14:7 13:6 12:5 11:4 10:3 9:2 8:1 7:0 6:0 5:0 4:0
Critical Path
15:0 14:0 13:0 12:0 11:0 10:0 9:0 8:0 7:0 6:0 5:0 4:0 3:0 2:0 1:0 0:0
S. Ibrahim
38
Tree Adders Summary
S. Ibrahim
39
Adders Comparison
S. Ibrahim
40
Reading
Rabaey: sections 11.1 – 11.3
Weste: sections 11.1 – 11.2
S. Ibrahim
41