### Chapter # 5: Arithmetic Circuits Contemporary Logic Design

```Programmable and Steering Logic
Chapter # 5: Arithmetic Circuits
5-1
Motivation
Programmable and Steering Logic
Arithmetic circuits are excellent examples of comb. logic design
Doing things fast requires more logic and thus more space
• Arithmetic Logic Units
Critical component of processor datapath
Inner-most "loop" of most computer instructions
5-2
Chapter Overview
Programmable and Steering Logic
Binary Number Representation
Sign & Magnitude, Ones Complement, Twos Complement
ALU Design
BCD Circuits
Combinational Multiplier Circuit
Design Case Study: 8 Bit Multiplier
5-3
Number Systems
Programmable and Steering Logic
Representation of Negative Numbers
Representation of positive numbers same in most systems
Major differences are in how negative numbers are represented
Three major schemes:
sign and magnitude
ones complement
twos complement
Assumptions:
we'll assume a 4 bit machine word
16 different values can be represented
roughly half are positive, half are negative
5-4
Number Systems
Sign and Magnitude Representation
-7
-6
-5
1111
1110
Programmable and Steering Logic
+0
0000
0001
1101
+1
0010
+2
+
-4
1100
0011
+3
0 100 = + 4
-3
1011
0100
+4
1 100 = - 4
-2
1010
0101
1001
-1
+5
-
0110
1000
-0
0111
+6
+7
High order bit is sign: 0 = positive (or zero), 1 = negative
Three low order bits is the magnitude: 0 (000) thru 7 (111)
n-1
Number range for n bits = +/-2
-1
Representations for 0
5-5
Programmable and Steering Logic
Number Systems
Sign and Magnitude
Must compare magnitudes to determine sign of result
Ones Complement
N is positive number, then N is its negative 1's complement
n
N = (2 - 1) - N
2 4 = 10000
-1
= 00001
Example: 1's complement of 7
1111
-7
Shortcut method:
=
0111
1000
= -7 in 1's comp.
simply compute bit wise complement
0111 -> 1000
5-6
Programmable and Steering Logic
Number Systems
Ones Complement
-0
-1
-2
1111
1110
+0
0000
0001
1101
+1
0010
+2
+
-3
1100
0011
+3
0 100 = + 4
-4
1011
0100
+4
1 011 = - 4
-5
1010
0101
1001
-6
+5
-
0110
1000
-7
0111
+6
+7
Subtraction implemented by addition & 1's complement
Still two representations of 0! This causes some problems
5-7
Programmable and Steering Logic
Number Representations
Twos Complement
-1
-2
-3
like 1's comp
except shifted
one position
clockwise
1111
1110
+0
0000
0001
1101
+1
0010
+2
+
-4
1100
0011
+3
0 100 = + 4
-5
1011
0100
+4
1 100 = - 4
-6
1010
0101
1001
-7
+5
-
0110
1000
-8
0111
+6
+7
Only one representation for 0
One more negative number than positive number
5-8
Programmable and Steering Logic
Number Systems
Twos Complement Numbers
n
N* = 2 - N
4
2 = 10000
Example: Twos complement of 7
sub 7 =
0111
1001 = repr. of -7
Example: Twos complement of -7
4
2 = 10000
sub -7 =
1001
0111 = repr. of 7
Shortcut method:
Twos complement = bitwise complement + 1
0111 -> 1000 + 1 -> 1001 (representation of -7)
1001 -> 0110 + 1 -> 0111 (representation of 7)
5-9
Number Representations
Programmable and Steering Logic
Sign and Magnitude
result sign bit is the
same as the operands'
sign
when signs differ,
operation is subtract,
sign of result depends
on sign of number with
the larger magnitude
4
0100
-4
1100
+3
0011
+ (-3)
1011
7
0111
-7
1111
4
0100
-4
1100
-3
1011
+3
0011
1
0001
-1
1001
5-10
Programmable and Steering Logic
Number Systems
Ones Complement Calculations
4
0100
-4
1011
+3
0011
+ (-3)
1100
7
0111
-7
10111
End around carry
1
1000
4
0100
-4
1011
-3
1100
+3
0011
1
10000
-1
1110
End around carry
1
0001
5-11
Programmable and Steering Logic
Number Systems
Addition and Subtraction of Binary Numbers
Ones Complement Calculations
Why does end-around carry work?
n
Its equivalent to subtracting 2 and adding 1
n
n
M - N = M + N = M + (2 - 1 - N) = (M - N) + 2 - 1
n
n
-M + (-N) = M + N = (2 - M - 1) + (2 - N - 1)
n
n
= 2 + [2 - 1 - (M + N)] - 1
(M > N)
M+N<2
n-1
after end around carry:
n
= 2 - 1 - (M + N)
this is the correct form for representing -(M + N) in 1's comp!
5-12
Programmable and Steering Logic
Number Systems
Addition and Subtraction of Binary Numbers
Twos Complement Calculations
4
0100
-4
1100
+3
0011
+ (-3)
1101
7
0111
-7
11001
If carry-in to sign =
carry-out then ignore
carry
if carry-in differs from
carry-out then overflow
4
0100
-4
1100
-3
1101
+3
0011
1
10001
-1
1111
Simpler addition scheme makes twos complement the most common
choice for integer number systems within digital systems
5-13
Number Systems
Programmable and Steering Logic
Addition and Subtraction of Binary Numbers
Twos Complement Calculations
Why can the carry-out be ignored?
-M + N when N > M:
n
n
M* + N = (2 - M) + N = 2 + (N - M)
Ignoring carry-out is just like subtracting 2
n
-M + -N where N + M < or = 2 n-1
n
n
-M + (-N) = M* + N* = (2 - M) + (2 - N)
n
n
= 2 - (M + N) + 2
After ignoring the carry, this is just the right twos compl.
representation for -(M + N)!
5-14
Programmable and Steering Logic
Number Systems
Overflow Conditions
Add two positive numbers to get a negative number
or two negative numbers to get a positive number
-1
-2
1111
0001
-4
1101
0010
1100
-5
0100
1010
0101
1001
-7
0110
1000
-8
0111
+6
+7
5 + 3 = -9
-3
+2
0011
1011
-6
-2
+1
0000
1110
-3
-1
+0
+3
-4
1111
+1
0000
1110
0001
1101
0010
1100
-5
1011
+4
+5
+0
1010
-6
0110
1000
-8
0011
+3
0100
+4
0101
1001
-7
+2
0111
+5
+6
+7
-7 - 2 = +7
5-15
Programmable and Steering Logic
Number Systems
Overflow Conditions
5
0111
0101
-7
1000
1001
3
0011
-2
1100
-8
1000
7
10111
Overflow
Overflow
5
0000
0101
-3
1111
1101
2
0010
-5
1011
7
0111
-8
11000
No overflow
No overflow
Overflow when carry in to sign does not equal carry out
5-16
Programmable and Steering Logic
With twos complement numbers, addition is sufficient
Ai Bi Sum Carry
0 0
0
0
0 1
1
0
1 0
1
0
1 1
0
1
Ai 0
Bi
0 0
1
1
0
1
1
Sum = Ai Bi + Ai Bi
Ai 0
Bi
0
0
1
0
1
1
0
Carry = Ai Bi
= Ai + Bi
Ai
Sum
Bi
Carry
5-17
Programmable and Steering Logic
A3 B3
A2 B2
A1 B1
+
+
S3
C3
A0 B0
+
S2
C2
+
S1
C1
S0
usually interested in adding more than two bits
this motivates the need for the full adder
5-18
Programmable and Steering Logic
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 01 11 10
S
0
0
1
0
1
1
1
0
1
0
AB
CI 00 01 11 10
CO
0
0
0
1
0
1
0
1
1
1
S = CI xor A xor B
CO = B CI + A CI + A B = CI (A + B) + A B
5-19
Programmable and Steering Logic
Standard Approach: 6 Gates
A
B
A
B
S
CI
CI
CO
A
B
Alternative Implementation: 5 Gates
A
B
S
A+B
Half
S
A + B + CI
Half
Adder CO CI (A + B)
S
CI
+
CO
A B + CI (A xor B) = A B + B CI + A CI
5-20
Programmable and Steering Logic
A 3 B 3 B3
A 2 B2 B2
0 1 Sel
A
B
CO +
CI
A 1 B1 B1
0 1 Sel
0 1 Sel
A
B
CO +
CI
A 0 B 0 B0
A
B
CO +
CI
0 1 Sel
A
B
CO +
S
S
S
S
S3
S2
S1
S0
CI
Overflow
A - B = A + (-B) = A + B + 1
5-21
Programmable and Steering Logic
Critical delay: the propagation of carry from low to high order stages
late
arriving
signal
@0
@0
A
B
@1
@N+1
@N CI
@0
@0
CO
@N+2
A
B
@1
two gate delays
to compute CO
C0
A0
4 stage
B0
S0 @2
0
C1 @2
A1
B1
S1 @3
1
C2 @4
A2
B2
2
S2 @5
C3 @6
A3
B3
3
S3 @7
C4 @8
final sum and
carry
5-22
Programmable and Steering Logic
Critical delay: the propagation of carry from low to high order stages
1111 + 0001
worst case
T0: Inputs to the adder are valid
T2: Stage 0 carry out (C1)
T4: Stage 1 carry out (C2)
2 delays to compute sum
until 6 delays later
T6: Stage 2 carry out (C3)
T8: Stage 3 carry out (C4)
5-23
Programmable and Steering Logic
Carry Generate Gi = Ai Bi
must generate carry when A = B = 1
Carry Propagate Pi = Ai xor Bi
carry in will equal carry out here
Sum and Carry can be reexpressed in terms of generate/propagate:
Si = Ai xor Bi xor Ci = Pi xor Ci
Ci+1 = Ai Bi + Ai Ci + Bi Ci
= Ai Bi + Ci (Ai + Bi)
= Ai Bi + Ci (Ai xor Bi)
= Gi + Ci Pi
5-24
Programmable and Steering Logic
Reexpress the carry logic as follows:
C1 = G0 + P0 C0
C2 = G1 + P1 C1 = G1 + P1 G0 + P1 P0 C0
C3 = G2 + P2 C2 = G2 + P2 G1 + P2 P1 G0 + P2 P1 P0 C0
C4 = G3 + P3 C3 = G3 + P3 G2 + P3 P2 G1 + P3 P2 P1 G0 + P3 P2 P1 P0 C0
Each of the carry equations can be implemented in a two-level logic
network
Variables are the adder inputs and carry in to stage 0!
5-25
Programmable and Steering Logic
Ai
Bi
Pi @ 1 gate delay
Ci
Si @ 2 gate delays
Generate Outputs
Gi @ 1 gate delay
Increasingly complex logic
C0
P0
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
G3
5-26
Programmable and Steering Logic
logic generates
individual carries
C0
A0
S0 @2
B0
C1 @3
sums computed
much faster
A1
S1 @4
B1
C2 @3
A2
S2 @4
B2
C3 @3
A3
S3 @4
B3
C4 @3
5-27
Programmable and Steering Logic
4
4
4
C16 A [15-12] B[15-12] C12
P G
4
4
@2 @3
C16
@5
P3
C4
G3
4
A [11-8] B[1 1-8]
P G
@8
S[15-12]
4
C3
A [7-4]
B[7-4]
P G
C8
4
@8
S[1 1-8]
@5
@2 @3
P2
G2
4
C2
A [3-0]
B[3-0]
P G
C4
@7
S[7-4]
@5
4
4
4
@2 @3
P1 G1
C0
@0
@4
S[3-0]
@4
C1
@2 @3
P0
G0
C0
P3-0
@3
G3-0
C0
@0
@5
P=P0P1P2P3
G=G3+G2P3+G1P3P2+G0P3P2P1
5-28
Programmable and Steering Logic
Redundant hardware to make carry calculation go faster
C8
C4
C8
4¥
2:1 Mux
C8
0
[7:4]
1
[7:4]
1 0 1 0 1 0
S7
S6
S5
Low
1 0
S4
High
C4
C0
[3:0]
S3
S2
S1
S0
compute the high order sums in parallel
one addition assumes carry in = 0
the other assumes carry in = 1
If C4 is low, choose C8 from Adder Low
If C4 is high, choose C8 from Adder High
5-29
Programmable and Steering Logic
5-30
Programmable and Steering Logic
Arithmetic Logic Unit Design
Sample ALU
M = 0, Logical Bitwise Operations
S1 S0
0 0
0 1
1 0
1 1
M=
0
0
1
1
Function
Fi = Ai
Fi = not Ai
Fi = Ai xor Bi
Fi = Ai xnor Bi
Comment
Input Ai transferred to output
Complement of Ai transferred to output
Compute XOR of Ai, Bi
Compute XNOR of Ai, Bi
1, C0 = 0, Arithmetic Operations
0
F=A
Input A passed to output
1
F = not A
Complement of A passed to output
0
F = A plus B
Sum of A and B
1
F = (not A) plus B
Sum of B and complement of A
M = 1, C0 = 1, Arithmetic Operations
0
0
1
1
0
1
0
1
F = A plus 1
F = (not A) plus 1
F = A plus B plus 1
F = (not A) plus B plus 1
Increment A
Twos complement of A
Increment sum of A and B
B minus A
Logical and Arithmetic Operations
Not all operations appear useful, but "fall out" of internal logic
5-31
Programmable and Steering Logic
Arithmetic Logic Unit Design
M
0
Sample ALU
S1
0
S0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
Truth Table & Espresso
23 product terms!
Equivalent to
25 gates
.i 6
.o 2
.ilb m
.ob fi
.p 23
111101
110111
1-0100
1-1110
1001010111-10001
010-01
-11011
011-11
--1000
0-1-00
--0010
0-0-10
-0100001-0-0001000-1-1-1-1
--1-01
--0-11
--110--011.e
s1 s0 ci ai bi
co
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
01
01
01
01
01
1
1
Ci
X
X
X
X
X
X
X
X
X
X
X
X
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
Ai
0
1
0
1
0
0
1
1
0
0
1
1
0
1
0
1
0
0
1
1
0
0
1
1
0
1
0
1
0
0
1
1
0
0
1
1
Bi
X
X
X
X
0
1
0
1
0
1
0
1
X
X
X
X
0
1
0
1
0
1
0
1
X
X
X
X
0
1
0
1
0
1
0
1
Fi
0
1
1
0
0
1
1
0
1
0
0
1
0
1
1
0
0
1
1
0
1
0
0
1
1
0
0
1
1
0
0
1
0
1
1
0
Ci+1
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
0
0
0
1
0
1
0
0
0
1
1
0
0
1
1
1
1
1
0
1
5-32
Programmable and Steering Logic
Arithmetic Logic Unit Design
Sample ALU
Multilevel Implementation
.model alu.espresso
.inputs m s1 s0 ci ai bi
.outputs fi co
.names m ci co    fi
110--- 1
-1-11- 1
--01-1 1
--00-0 1
\S1
.names m ci   co
\Bi
-1-1 1
--11 1
M
S1
111- 1
Bi
.names s0 ai 
01 1
S0
10 1
Ai
.names m s1 bi 
111 1
.names s1 bi 
0- 1
-0 1
.end


Ci



Co
M
Ci


M
Ci
\Co
Ci


\Co


\Co
\
\
Fi
12 Gates
5-33
Programmable and Steering Logic
Arithmetic Logic Unit Design
Sample ALU
Clever Multi-level Logic Implementation
S1 Bi
S0
Ai
M
X1
A1
Ci
S1 = 0 blocks Bi
Happens when operations involve Ai
only
A2
Same is true for Ci when M = 0
Addition happens when M = 1
X2
Bi, Ci to Xor gates X2, X3
S0 = 0, X1 passes A
S0 = 1, X1 passes A
A3
A4
O1
Ci+1
Arithmetic Mode:
Or gate inputs are Ai Ci and
Bi (Ai xor Ci)
X3
Logic Mode:
Fi
8 Gates (but 3 are XOR)
Ai and Bi
5-34
Arithmetic Logic Unit Design
Programmable and Steering Logic
74181 TTL ALU
S3
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
Selection
S2 S1 S0
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
M=1
Logic Function
F = not A
F = A nand B
F = (not A) + B
F=1
F = A nor B
F = not B
F = A xnor B
F = A + not B
F = (not A) B
F = A xor B
F=B
F = A+ B
F=0
F = A (not B)
F = AB
F=A
M = 0, Arithmetic Functions
Cn = 0
Cn = 1
F = A minus 1
F=A
F = A B minus 1
F = AB
F = A (not B) minus 1
F = A (not B)
F = minus 1
F = zero
F = A plus (A + not B)
F = A plus (A + not B) plus 1
F = A B plus (A + not B)
F = A B plus (A + not B) plus 1
F = A minus B minus 1
F = (A + not B) plus 1
F = A + not B
F = A minus B
F = A plus (A + B)
F = (A + not B) plus 1
F = A plus B
F = A plus (A + B) plus 1
F = A (not B) plus (A + B)
F = A (not B) plus (A + B) plus 1
F = (A + B)
F = (A + B) plus 1
F=A
F = A plus A plus 1
F = A B plus A
F = AB plus A plus 1
F= A (not B) plus A
F = A (not B) plus A plus 1
F=A
F = A plus 1
5-35
Programmable and Steering Logic
Arithmetic Logic Unit Design
74181 TTL ALU
Note that the sense of the carry in and out are
OPPOSITE from the input bits
19
21
23
2
18
20
22
1
A3
A2
A1
A0
B3
B2
B1
B0
7 Cn
8 M
181
F3
F2
F1
F0
13
11
10
9
A=B 14
Cn+4 16
G 17
P 15
S3 S2 S1 S0
3 4 5 6
6
15
2
4
5
14
1
3
182
P3
P2
P1
P0
G3
G2
G1
G0
P
G
7
10
Cn+z 9
Cn+y 11
Cn+x 12
13 Cn
maintains the correct sense of the signals
5-36
Programmable and Steering Logic
Arithmetic Logic Unit Design
19 A3
21 A2 181 F3
23 A1
F2
2 A0
F1
18 B3
F0
20 B2
A=B
22 B1
Cn+4
1 B0
G
7 Cn
P
8M
S3S2S1S0
3 4 5 6
4 bit ALU x 4 + CLA
19
21
23
2
18
20
22
1
7
8
A3
A2
A1
A0
B3
B2
B1
B0
Cn
M
13
11
10
9
14
16
17
15
F3 13
F2 11
F1 10
F0 9
A=B 14
Cn+4 16
G 17
P 15
181
S3S2S1S0
3 4 5 6
19 A3
21 A2
23 A1
2 A0
18 B3
20 B2
22 B1
1 B0
7 Cn
8M
C16
F3
F2
F1
F0
A=B
Cn+4
G
P
181
13
11
10
9
14
16
17
15
6 P3182
15 P2
2 P1
P
4 P0
G
5 G3
14 G2 Cn+z
1 G1 Cn+y
3 G0 Cn+x
13 Cn
7
10
9
11
12
S3 S2S1S0
3 4 5 6
C0
19
21
23
2
18
20
22
1
7
8
A3
A2
A1
A0
B3
B2
B1
B0
Cn
M
F3
F2
F1
F0
A=B
Cn+4
G
P
181
13
11
10
9
14
16
17
15
S3S2S1S0
3 4 5 6
5-37
Programmable and Steering Logic
BCD Number Representation
Decimal digits 0 thru 9 represented as 0000 thru 1001 in binary
5 = 0101
3 = 0011
1000 = 8
5 = 0101
8 = 1000
Problem
when digit
sum exceeds 9
1101 = 13!
Solution: add 6 (0110) if sum exceeds 9!
5 = 0101
9 = 1001
8 = 1000
7 = 0111
1101
6 = 0110
1 0011 = 1 3 in BCD
1 0000 = 16 in binary
6 = 0110
1 0110 = 1 6 in BCD
5-38
Programmable and Steering Logic
A3
B3
CO FA
CI
S
A1
11XX
A2
1X1X
A2
B2
CO FA
S3
B1
CO FA
CI
A0
CI
CO FA
S
S
S2
S1
B0
CO FA
S
S
CO FA
Cout
CI
A1
CI
Cin
S
CI
0
S0
Add 0110 to sum whenever it exceeds 1001 (11XX or 1X1X)
5-39
Programmable and Steering Logic
Combinational Multiplier
Basic Concept
multiplicand
multiplier
1101 (13)
* 1011 (11)
product of 2 4-bit numbers
is an 8-bit number
1101
1101
Partial products
0000
1101
10001111
(143)
5-40
Programmable and Steering Logic
Combinational Multiplier
Partial Product Accumulation
S7
A3
A2
A1
A0
B3
B2
B1
B0
A2 B0
A2 B0
A1 B0
A0 B0
A3 B1
A2 B1
A1 B1
A0 B1
A3 B2
A2 B2
A1 B2
A0 B2
A3 B3
A2 B3
A1 B3
A0 B3
S6
S5
S4
S3
S2
S1
S0
5-41
Programmable and Steering Logic
Combinational Multiplier
Partial Product Accumulation
A 3 B3 A 3 B2 A 2 B3 A 3 B1 A 2 B2 A 1 B3 A 3 B0 A 2 B1 A 1 B2 A 0 B3 A 2 B0 A 1 B 1 A 0 B 2 A 0 B 1 A 1 B 0 A 0 B0
FA
FA
S7
HA
FA
FA
FA
FA
HA
FA
S6
S5
S4
S3
HA
HA
FA
S2
S1
S0
Note use of parallel carry-outs to form higher order sums
12 Adders, if full adders, this is 6 gates each = 72 gates
16 gates form the partial products
total = 88 gates!
5-42
Programmable and Steering Logic
Combinational Multiplier
Another Representation of the Circuit
Sum In
X
Building block: full adder + and
Cin
Y
FA
A B
CO CI
S
Cout
Sum Out
A3
B0
A3 B0
C
B1
A3 B1
C
B2
A3 B2
C
B3
C
A2 B2
C
S
S
S
A2 B3
A1 B3
A0 B3
S
S
S
S
P6
P5
P4
P3
A0
A2 B0
A1 B0
A0 B0
S
C
A1 B1
C
A1 B2
C
A1
C
A2 B1
A3 B3
C
P7
S
S
S
A2
S
S
C
S
A0 B1
C
S
A0 B2
C
S
P2
P1
P0
4 x 4 array of building blocks
5-43
Programmable and Steering Logic
Case Study: 8 x 8 Multiplier
TTL Multipliers
A0
A1
A2
A3
B0
B1
B2
B3
14
2
8
4
G
A
13
4 7 6 5 15 1 2 3
A A A A B B B B G
3 2 1 0 3 2 1 0 B
14
2
8
5
Y Y Y Y
7 6 5 4
9 10 11 12
Y6
Y7
Y4
Y5
Y2
Y3
G
A
13
4 7 6 5 15 1 2 3
A A A A B B B B G
3 2 1 0 3 2 1 0 B
Y Y Y Y
3 2 1 0
9 10 11 12
Y0
Y1
Two chip implementation of 4 x 4 multipler
5-44
Programmable and Steering Logic
Case Study: 8 x 8 Multiplier
Problem Decomposition
How to implement 8 x 8 multiply in terms of 4 x 4 multiplies?
*
A7-4
A3-0
B7-4
B3-0
A3-0 * B3-0
8 bit products
A7-4 * B3-0
= PP1
A3-0 * B7-4
= PP2
A7-4 * B7-4
P15-12
= PP0
P11-8
= PP3
P7-4
P3-0
P3-0 = PP0 3-0
P7-4 = PP0 7-4 + PP1
+ PP2
+ Carry-in
3-0
3-0
P11-8 = PP1 7-4 + PP2 7-4 + PP3 3-0 + Carry-in
+ Carry-in
P15-12 = PP3 7-4
5-45
Programmable and Steering Logic
Case Study: 8 x 8 Multiplier
Calculation of Partial Products
A6
A7
A4
A5
B6 B4
B7 B5
4 x 4 Multiplier
74284/285
PP3
7-4
PP3
3-0
A2
A3
A0
A1
B6 B4
B7 B5
4 x 4 Multiplier
74284/285
PP2
7-4
PP2
3-0
A6
A7
A4
A5
B2 B0
B3 B1
A2
A3
4 x 4 Multiplier
74284/285
PP1
7-4
PP1
3-0
A0
A1
B2 B0
B3 B1
4 x 4 Multiplier
74284/285
PP0
7-4
PP0
3-0
Use 4 74284/285 pairs to create the 4 partial products
5-46
Programmable and Steering Logic
Case Study: 8 x 8 Multiplier
Clever use of the Carry Inputs
Sum A[3-0], B[3-0], C[3-0]:
FA
C3
FA
A0 B0
A1 B1
A2 B2
A3 B3
C2
FA
C1
FA
FA
FA
S3
S2
S1
FA
C0
0
S0
Note: Carry lookahead schemes also possible!
5-47
Programmable and Steering Logic
Case Study: 8 x 8 Multiplier
C3 B3 A3 C2 B2 A2 C1 B1 A1 C0 B0 A0
Cn B A Cn B A
74183
74183
Cn+1 S Cn+1 S
Cn B A Cn B A
74183
74183
Cn+1 S Cn+1 S
(2 per package)
+
B3 A3
G
P
Cn+4
F3
B2 A2
B1 A1
74181
B0 A0
Standard ALU configured as 4-bit
Cn
F2
F1
F0
S
3
S
S
1
2
S
0
Note the off-set in the outputs
5-48
Programmable and Steering Logic
Case Study: 8 x 8 Multiplier
Accumulation of Partial Products
PP1
PP2
PP3
PP3
7
6
PP3
5
PP3
4
PP3
7
7
PP3
PP1
2
PP2
PP2
2
PP1 PP3
6
1
3
Cn B A Cn B A
74183
74183
Cn+ 1 S Cn+ 1 S
5
PP3
5
PP0
0
PP2
4
PP1
Cn B A Cn B A
74183
74183
Cn+ 1 S Cn+ 1 S
PP1
4
PP2
3
7
PP2
PP0
2
PP1
PP1
2
PP0 PP2
6
1
3
Cn B A Cn B A
74183
74183
Cn+ 1 S Cn+ 1 S
5
PP2
1
0
PP1
0
PP0
4
Cn B A Cn B A
74183
74183
Cn+ 1 S Cn+ 1 S
+
B3 A3
G
P
Cn+ 4
F3
B2 A2
B1 A1
74181
B0 A0
Cn
F2
F1
F0
P
15
P
14
P
13
B3 A3
G
P
Cn+ 4
F3
P
12
B2 A2
B1 A1
B0 A0
F2
F1
F0
B3 A3
G
P
Cn+ 4
F3
P
11
P
10
P
9
P
8
74181
Cn
B2 A2
B1 A1
74181
B0 A0
Cn
F2
F1
F0
P
7
P
P
5
6
P
4
5-49
Programmable and Steering Logic
Case Study: 8 x 8 Multiplier
The Complete System
A7- 0
B7- 0
8
8
Partial Product Calculat ion
4 x 74284, 74285
4
4
PP3
PP3
7-4
PP2
3-0
4
4
7-4
PP2
PP1
3-0
4
0
G
P
Cn+4
PP3
7
PP3
74181
P
15
P
14
P
13
7-4
4
PP1
PP0
3-0
G
P
Cn+4
P
12
74181
P
11
P
10
4
4
PP0
7-4
4
4
2 x 74183
PP3 PP3
4
6
5
Cn
4
4
3-0
4
4
2 x 74183
Cn
P
9
P
8
74181
P
7
P
Cn
6
P
5
P
4
P
3-0
+
G3 P3 G2 P2 G1 P1 G0 P0
74182
Cn
Cn+z
Cn+y Cn+x
G
P
Cn+4
+
5-50
Case Study: 8 x 8 Multiplier
Package Count and Performance
Programmable and Steering Logic
4 74284/74285 pairs = 8 packages
4 74183, 3 74181, 1 74182 = 8 packages
16 packages total
Partial product calculation (74284/285) = 40 ns typ, 60 ns max
Intermediate sums (74183) = 9 ns/20ns = 15 ns average, 33 ns max
74LS181: carry G and P = 20 ns typ, 30 ns max
74182: second level carries = 13 ns typ, 22 ns max
74LS181: formations of sums = 15 ns typ, 26 ns max
103 ns typ, 171 ns max
5-51
Chapter Review
Programmable and Steering Logic
We have covered:
• Binary Number Representation
positive numbers the same
difference is in how negative numbers are represented
twos complement easiest to handle:
one representation for zero, slightly