Professional Documents
Culture Documents
Acknowledgements:
Materials in this lecture are courtesy of the following sources and are used with permission.
Rex Min
Kevin Atkinson
Prof. Randy Katz (Unified Microelectronics Corporation Distinguished Professor in Electrical
Engineering and Computer Science at the University of California, Berkeley) and Prof. Gaetano
Borriello (University of Washington Department of Computer Science & Engineering) from
Chapter 2 of R. Katz, G. Borriello. Contemporary Logic Design. 2nd ed. Prentice-Hall/Pearson
Education, 2005.
J. Rabaey, A. Chandrakasan, B. Nikolic, Digital Integrated Circuits: A Design Perspective
Prentice Hall/Pearson, 2003.
L8/9: 6.111 Spring 2006
-(2N-1 1) to +(2N-1 1)
Two representations for zero: 0000 & 1000
Simple multiplication but complicated addition/subtraction
_
Ones complement: if N is positive then its negative is N
Example:
0111 = 7, 1000 = -7
Range: -(2N-1 1) to +(2N-1 1)
Two representations for zero: 0000 & 1111
Subtraction implemented as addition and negation
0100
-4
1100
0100
-4
1100
+3
0011
+ (-3)
1101
-3
1101
+3
0011
0111
-7
11001
10001
-1
1111
[Katz05]
L8/9: 6.111 Spring 2006
Overflow Conditions
Add two positive numbers to get a negative number or two negative numbers
to get a positive number
-2
-3
-4
-1
+0
-1
1111
1110
0001
1101
0010
1100
-5
+3
0101
1001
-7
0110
1000
0111
-8
-4
+6
1110
5 + 3 = -8!
0001
1101
0010
1010
-6
0011
+3
0100
+4
1001
-7
0110
1000
-7 - 2 = +7!
0111
+7
-7
0011
-2
1100
01000
5
3
-8
+5
+6
1000
1001
0111
0101
+2
0101
-8
+7
+1
0000
1011
+4
+5
1111
1100
-5
0100
1010
-3
+2
0011
1011
-6
-2
+1
0000
+0
10111
If carry in to sign equals carry out then can ignore carry out, otherwise have overflow
L8/9: 6.111 Spring 2006
Full
Adder
Ci
S = A B Ci
= ABCi + ABCi + ABCi + ABCi
Co
Co = AB + Ci (A+B)
S
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
CI
0
1
0
1
0
1
0
1
S
0
1
1
0
1
0
0
1
CO
0
0
0
1
0
1
1
1
AB
CI
00
11
10
AB
CI
00
01
11
10
CO
01
B3 A3
Co,3
B1 A1
B2 A2
S2
Co,1
Full
Adder
S1
B0 A0
Co,0
Full
Adder
Ci,0
S0
Extension to Subtraction
Under twos complement, subtracting B is the same as
adding the bitwise complement of B then adding 1
Combination addition/subtraction system:
_
Co,3
B2
B3
A2
0 1
FA
S3
Co,2
B1
B2
A1
0 1
FA
S2
Co,1
B1
B0
A0
0 1
FA
Co,0
S1
B0
0 1
Add/Subtract
FA
S0
Add 1 for
subtraction using
carry in
Overflow occurs if carry in to sign bit differs from final carry out
overflow
L8/9: 6.111 Spring 2006
A2
0 1
FA
Co,3
B2
B3
Co,2
B1
B2
A1
0 1
FA
Co,1
B0
A0
0 1
FA
S2
S3
B1
Co,0
B0
0 1
FA
S1
S0
N
true if negative
result
A<B = N
A=B = Z
AB = Z+N
L8/9: 6.111 Spring 2006
Cin
Full
Adder
Co
S
Generate (G) = AB
Propagate (P) = A B
B0
A1
Ci,0
G0 P1
FA
Co,0
P0
FA
P2
Co,0
A3
FA
Co,1
FA
P3
G3
FA
Co,2
P,G
G1
P2
Co,1
B3
P,G
G2
P,G
G0 P1
FA
B2
P,G
G1
P,G
Ci,0
A2
P,G
P,G
P0
B1
FA
Co,3
BP= P0P1P2P3
P,G
G2
P3
Co,2
Can compute P, G
in parallel for all bits
G3
FA
Co,3
10
BP= P0P1P2P3
P,G
Ci,0
P,G
P,G
P,G
FA FA FA FA
Co,0
Co,1
BP= P4P5P6P7
Co,2
P,G
0
1
Co,3
P,G
P,G
P,G
FA FA FA FA
Co,4
Co,5
BP= P8P9P10P11
Co,6
P,G
0
1
Co,7
P,G
P,G
P,G
FA FA FA FA
Co,8
Co,9
BP= P12P13P14P15
Co,10
P,G
Co,11
0
1
P,G
P,G
P,G
FA FA FA FA
Co,12
Co,13
Co,14
0
1
Co,15
What is the worst case propagation delay for the 16-bit adder?
11
BP= P0P1P2P3
P,G
Ci,0
P,G
P,G
P,G
FA FA FA FA
Co,0
Co,1
BP2= P4P5P6P7
Co,2
P,G
0
1
Co,3
P,G
P,G
P,G
FA FA FA FA
Co,4
Co,5
Co,6
BP3= P8P9P10P11
P,G
0
1
Co,7
P,G
P,G
P,G
FA FA FA FA
Co,8
Co,9
BP4= P12P13P14P15
Co,10
P,G
Co,11
0
1
P,G
P,G
P,G
FA FA FA FA
Co,12
Co,13
Co,14
0
1
Co,15
12
13
Pi
Ci
Si
Gi
C1
G0
C2
G1
P2
G2
G1
C0
P0
P1
P2
P3
G0
P1
P2
C0
P0
P1
G0
P1
C0
P0
P1
P2
C3
G0
P1
P2
P3
G1
P2
P3
G2
P3
C4
G3
L8/9: 6.111 Spring 2006
14
The carry out of a 4-bit block can thus be computed using only the block generate and propagate
signals for each 2-bit section, plus the carry in to bit 0. The same formulation will be used to generate
the carry out signals for a 16-bit adder using the block generate and propagate from 4-bit sections.
L8/9: 6.111 Spring 2006
15
More Definitions
( g, p ) ( g', p' ) = ( g + pg', pp' )
The above dot operator obeys the associative property, but it is not commutative
(G3:2,P3:2) = (G3,P3) (G2,P2)
= ( ( G k, P k ) ( G k 1 , P k 1 ) ( G , P ) )
0 0
( C i 0, 0 )
,
16
F
A1
A2
A3
A4
A5
A6
A7
tp: O(N)
A0
A1
A2
A3
A4
A5
A6
tp:O(log2N)
A7
L8/9: 6.111 Spring 2006
17
S0
S1
S2
S3
S4
S5
S6
S7
S8
S9
S10
S11
S12
S13
S14
S15
(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)
Sum Logic
Adder Performance
Ripple
Bypass
Select
Lookahead
19
IN11
IN01
IN10
IN00
IN2N-1
IN3N-1
INM-1N-1
IN2N-2
IN3N-2
INM-1N-2
IN21
IN31
INM-11
IN20
IN30
INM-10
Cin =0
Cin =0
Cin =0
Cin =0
20
A3:0
Cn
A7:4
B3:0
181 Cn+4
P
Cn
181 Cn+4
P
S3:0
P3:0
G3:0
Cin
A11:8
B7:4
Cn
B11:8
181 Cn+4
S11:8
S7:4
A15:12 B15:12
Cn
181 Cn+4
S15:12
P0 G0 P1 G1 P2 G2 P3 G3
G
P
182
Cn
Cn+x
Cn+y
Cn+z
21
Binary Multiplication
x3
x3
x1
x2
x1
x2
y0
x0
x0
y1
z0
x3
HA
FA
FA
x2
x1
x0
HA
y2
z1
x3
FA
FA
FA
x2
x1
x0
HA
y3
z2
z7
L8/9: 6.111 Spring 2006
FA
FA
FA
HA
z6
z5
z4
z3
22
[4]
D
x3
0
1
x2
0
1
xBus
[3]
D
[2]
CLK
yReg
CLK
L8/9: 6.111 Spring 2006
acc_out
LD
D Q
XY
CLK
CLK
Y3
0
1
Y1
x0
[0]
Y0
Shift/LD
Shift
[1]
x1
[5]
add_out
[6]
0
1
rst
Y2
Shift
xBus [7]
23
Timing Diagram
CLK
Shift
xreg
yreg
Acc_out
X*Y
0 0 0 0 x3 x2 x1 x0
0 0 0 x3 x2 x1 x0 0
0 0 x3 x2 x1 x0 0 0
0 x3 x2 x1 x0 0 0 0
0 0 0 0 x3 x2 x1 x0
y0 y1 y2 y3
y1 y2 y3 X
y2 y3 X X
y3 X X X
y0 y1 y2 y3
00000000
Accum_1
Accum_2
Accum_3
00000000
PRODUCT
PRODUCT
24
25
Simulation
26
x3
x3
x1
x2
x1
x2
x0
x0
y1
z0
x3
y0
FA
FA
FA
x2
x1
x0
HA
y2
z1
x3
FA
FA
FA
x2
x1
x0
y3
z2
HA
FA
FA
FA
HA
z7
z6
z5
z4
z3
HA
27
Summary
28