Beruflich Dokumente
Kultur Dokumente
A Design Perspective
Jan M. Rabaey Anantha Chandrakasan Borivoje Nikolic
Arithmetic Circuits
January, 2003
1
2d n
Arithmetic Circuits
CONTROL
DATAPATH
2d n
Arithmetic Circuits
Arithmetic Circuits
An Intel Microprocessor
9-1 Mux 5-1 Mux a CARRYGEN g64
SUMSEL
ck1
REG
node1
sum
sumb
to Cache
9-1 Mux
2-1 Mux
s0 s1
1000um
2d n
Arithmetic Circuits
Bit-Sliced Design
Control
Bit 3 Multiplexer Data-In Register Adder Bit 2 Bit 1 Bit 0 Shifter Data-Out
5
Arithmetic Circuits
Bit-Sliced Datapath
From register files / Cache / Bypass
Bit slice 63
Bit slice 2
Arithmetic Circuits
Arithmetic Circuits
Adders
2d n
Arithmetic Circuits
Full-Adder
A Cin B Cout Full adder Sum
2d n
Arithmetic Circuits
10
Arithmetic Circuits
Can also derive expressions for S and C o based on D and P Note that we will be sometimes using an alternate definition for Propagate (P) = A + B
EE141 Digital Integrated Circuits
2d n
11
Arithmetic Circuits
FA
FA
FA
FA
S0
S1
S2
S3
12
Arithmetic Circuits
28 Transistors
EE141 Digital Integrated Circuits
2d n
13
Arithmetic Circuits
Inversion Property
A Ci B A B
FA
Co
Ci
FA
Co
S S ( A, B, C i ) = S ( A, B , C i ) C ( A, B, C ) = C ( A, B , C ) o i o i
2d n
14
Arithmetic Circuits
FA
FA
S0
S1
S2
S3
2d n
15
Arithmetic Circuits
24 transistors
EE141 Digital Integrated Circuits
2d n
16
Arithmetic Circuits
Mirror Adder
Stick Diagram
VDD
Ci Co
A Ci
Co
Ci
S GND
EE141 Digital Integrated Circuits
2d n
17
Arithmetic Circuits
18
Arithmetic Circuits
VDD Ci Ci
2d n
19
Arithmetic Circuits
VDD
Ci
Pi
VDD
Co Gi
Co
2d n
20
Arithmetic Circuits
C0
C1
C2
C3
2d n
21
Arithmetic Circuits
2d n
22
Arithmetic Circuits
Carry-Bypass Adder
P0 Ci,0 G1
C o,0
P0
G1
C o ,1
P2
G2
Co,2
P3
G3 Co,3
FA
FA
FA
FA
P0 G1 Ci,0
C o ,0
P0
G1
Co,1
P2
G2
C o,2
P3
G3
BP=P oP1 P2 P3
Multiplexer
FA
FA
FA
FA
Co,3
Idea: If (P0 and P1 and P2 and P3 = 1) then C o3 = C0, else kill or generate.
23
2d n
Arithmetic Circuits
Carry propagation
Carry propagation
Carry propagation
Carry propagation
Sum M bits
Sum
Sum
tsum
Sum
2d n
24
Arithmetic Circuits
bypass adder
4..8
N
25
2d n
Arithmetic Circuits
Carry-Select Adder
Setup
P,G
"0"
"1"
Co,k-1
Multiplexer
Carry Vector
Co,k+3
Sum Generation
2d n
26
Arithmetic Circuits
1-Carry
1-Carry
1-Carry
1-Carry
Ci,0
Multiplexer
Co,3
Multiplexer
Co,7
Multiplexer
Co,11
Multiplexer
Co,15
Sum Generation S
2d n
27
Arithmetic Circuits
2d n
28
Arithmetic Circuits
2d n
29
Arithmetic Circuits
2d n
30
Arithmetic Circuits
AN-1, BN-1
Ci,0
P0 Ci,1
P1
Ci, N-1
PN-1
S0
S1
SN-1
C o, k = f (A k, B k, Co , k 1 ) = Gk + P k Co , k 1
2d n
31
Arithmetic Circuits
Look-Ahead: Topology
Expanding Lookahead equations:
C o, k = Gk + P k (Gk 1 + Pk 1 Co , k 2 )
G2 VDD
G1 G0 Ci,0 Co,3
P0 P1 P2 P3
2d n
32
Arithmetic Circuits
tp N
tp log2(N)
2d n
33
Arithmetic Circuits
2d n
34
Arithmetic Circuits
(A0, B0) S0 S1 S2 S3 S4 S5 S6 S7 S8 S9 (A10, B10) (A11, B11) (A12, B12) (A13, B13) (A14, B14) (A15, B15) S10 S11 S12 S13 S14 S15 (A1, B1) (A2, B2) (A3, B3) (A4, B4) (A5, B5) (A6, B6) (A7, B7) (A8, B8) (A9, B9)
Tree Adders
2d n
35
Arithmetic Circuits
(a0, b0) (a1, b1) (a2, b2) (a3, b3) (a4, b4) (a5, b5) (a6, b6) (a7, b7) (a8, b8) (a9, b9) (a10, b10) (a11, b11) (a12, b12) (a13, b13) (a14, b14) (a15, b15) S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15
Tree Adders
2d n
36
Arithmetic Circuits
(a0, b0) S0 S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 (a11, b11) (a12, b12) (a13, b13) (a14, b14) (a15, b15) S11 S12 S13 S14 S15 (a1, b1) (a2, b2) (a3, b3) (a4, b4) (a5, b5) (a6, b6) (a7, b7) (a8, b8) (a9, b9) (a10, b10)
Sparse Trees
37
Arithmetic Circuits
(A0, B0) (A1, B1) (A2, B2) (A3, B3) (A4, B4) (A5, B5) (A6, B6) (A7, B7) (A8, B8) (A9, B9) (A10, B10) (A11, B11) (A12, B12) (A13, B13) (A14, B14) (A15, B15)
Brent-Kung Tree
Tree Adders
2d n
38
Arithmetic Circuits
Clk
Pi= ai + bi
ai
ai
bi
bi
Clk
Clk
Propagate
Generate
2d n
39
Arithmetic Circuits
Clkk
Pi:i-2k+1
Gi:i-2k+1
Pi:i-k+1
Pi:i-k+1 Gi:i-k+1
Pi-k:i-2k+1
Gi-k:i-2k+1
Propagate
Generate
2d n
40
Arithmetic Circuits
Clk
Si0
Clkd Clk
Gi:0
Si1
Clk
2d n
41
Arithmetic Circuits
Multiplie rs
2d n
42
Arithmetic Circuits
XY
M + N 1
=
M 1 = Xi2 i=0 j = 0
k=0 N 1 i
Zk 2 Yj 2
i + j
M 1 N 1
=
i =0 j= 0
Xi Yj 2
with
M 1
X Y
EE141 Digital Integrated Circuits
2d n
i=0 N 1
=
Xi 2
j= 0
Yj 2
j
43
Arithmetic Circuits
Multiplicand Multiplier
Partial products
2d n
Arithmetic Circuits
2d n
45
Arithmetic Circuits
FA
FA
FA
HA
FA
FA
FA
HA
2d n
46
Arithmetic Circuits
Carry-Save Multiplier
HA HA HA HA HA FA FA FA
HA
FA
FA
FA
HA
FA
FA
HA
2d n
47
Arithmetic Circuits
Multiplier Floorplan
X3 X2 X1 X0 Y0 Y1 HA Multiplier Cell C S C S C S C S Z0 FA Multiplier Cell Y2 C S C S C S C S Z1 Vector Merging Cell
Y3
C S
C S
C S
C S Z2
C S
C S
C S
C S
Z7
Z6
Z5
Z4
Z3
2d n
48
Arithmetic Circuits
Wallace-Tree Multiplier
Partial products 6 5 4 3 2 1 0 First stage 6 5 4 3 2 1 0 Bit position
FA (c)
HA (d)
2d n
49
Arithmetic Circuits
Wallace-Tree Multiplier
Partial products x3y3 x3y2 x2y3 x2y2 x3y1 x1y2 x3y0 x1y1 x2y0 x0y1 x1y3 x0y3 x0y2 x1y0 x0y
First stage
HA
HA
Second stage
FA
FA
FA
FA
Final adder
z7 z6
z5
z4
z3
z2
z1
z0
2d n
50
Arithmetic Circuits
Wallace-Tree Multiplier
y0 y1 y2 Ci-1 y3 Ci FA y4 FA Ci FA y5 Ci FA C C S
2d n
y0 y1 y2
y3 y4 y5
FA
FA Ci-1 Ci Ci
FA Ci-1 Ci-1
Ci-1
Ci
Ci-1
FA
51
Arithmetic Circuits
Multipliers Summary
Optimization Goals Different Vs Binary Adder Once Again: Identify Critical Path Other possible techniques - Logarithmic versus Linear (Wallace Tree Mult) - Data encoding (Booth) - Pipelining FIRST GLIMPSE AT SYSTEM LEVEL OPTIMIZATION
2d n
52
Arithmetic Circuits
Shifters
2d n
53
Arithmetic Circuits
Ai
Bi
Ai-1
Bi-1
Bit-Slice i
...
EE141 Digital Integrated Circuits
2d n
54
Arithmetic Circuits
Sh0
Sh1
Sh2
Sh3
55
Arithmetic Circuits
A1
A0
S0 h
S h1
Sh 2
S3 h
B ffe u r
Widthbarrel
EE141 Digital Integrated Circuits
2d n
~ 2 pm M
56
Arithmetic Circuits
Logarithmic Shifter
Sh1 Sh1 Sh2 Sh2 Sh4 Sh4
A3
B3
A2
B2
A1
B1
A0
B0
2d n
57
Arithmetic Circuits
Out2
Out1
Out0
2d n
58
Arithmetic Circuits