Arithmetic Circuits
Arithmetic Circuits
Block-Level Design
4-bit Parallel Adder BCD-to-Excess-3 Code Converter 16-bit Parallel Adder 4-bit Parallel Adder cum Subtractor
Arithmetic Circuits
Introduction
combinational sequential
::
::
Introduction
::
Combinational Logic
::
outputs
Output depends on both present and past inputs. Memory (via feedback loop) contains past information.
Memory
Analysis Procedure
function?
A B A+B
F1 = (A+B).(A'+B')
F2 = (A'+B')' = A.B
A'+B'
Steps:
1. Label the inputs and outputs.
2. Obtain the functions of intermediate points and the outputs. 3. Draw the truth table. 4. Deduce the functionality of the circuit half adder.
A B 0 0 0 1 1 0 1 1
(A+B) (A'+B') F1 0 1 0 1 1 1 1 1 1 1 0 0
F2 0 0 0 1
Design Methods
Different combinational circuit design methods:
Gate-level method (with logic gates)
Design Methods
Half Adder
(X + Y)
S C
Half Adder
C
Half-adder adds up only two bits. To add two binary numbers, we need to add Example:
+ 0 0 1 0 1 0 1 1 1 1 1 0 carry X Y S
Need Full Adder (so called as it can be made from two halfadders).
X Y Z
Full Adder
(X + Y + Z)
S
C
Note: Z - carry in (to the current position) C - carry out (to the next position)
YZ
X
C
00 01 11 1 10
0 1
YZ
X
S
00 01 11 1 1 1 10 1
0 1
S
(XY)
C Z
Block diagrams.
Sum
Half Adder
Carry
(X.Y)
X Y
Sum
Half Adder
Carry
C Z
Code Converters
Code converters take an input code, translate to its
equivalent output code.
Input code
Code converter
Output code
K-maps:
AB CD
C 01 1 X X 1 11 10 1 X X 1 X X
AB
CD
C 01 1 11 10 1 1 B
00
00
00 01 A 11 B A
00 01 1 11 10 X
X 1
X X
X X
10 1
W
CD
X
C
CD
C 01 11 10 1 1 X X X D X X B
AB
00
01
11 10 1 1 B
AB
00
00 1 01 1 A 11 X X
00 1 01 1 A 11 X
X X D
X X
10 1
10 1
C 01 1 X X 1 D 11 10 1 X X 1 X X
AB
CD
C 01 1 11 10 1 1 B
00
00
00
00 B A
01
A 11
01 1
11 10 X X 1 D X X X X
10 1
W
CD
X
C
CD
C 01 11 10 1 1 X X X D X X B
AB
00
01
11 10 1 1 B
AB
00
00 1 01 1 A 11 X X
00 1 01 1 A 11 X
Z = D'
X X D
X X
10 1
10 1
Subtractor
X 0 0 1 1
Y 0 1 0 1
B 0 1 0 0
D 0 1 1 0
Full Subtractor
Bi+1=XiYi+XiBi+YiBi
Di=Xi Yi Bi
C5
C1
Black-box view of 4-bit parallel adder
S4 S3 S2 S1
Si = Xi Yi Ci
Y3 X3
C3
Y2 X2
C2
Y1 X1
C5
FA
FA
FA
FA
C1
S4
Input
Output
S3
S2
S1
Parallel Adders
Note that carry propagated by cascading the carry
from one full adder to the next.
Block-level circuit:
BCD code
X4 X3 X2 X1 0 0 1 1
unused Cout
Y4 Y3 Y2 Y1
S4 S3 S2 S1
Excess-3 code
X12..X9 Y12..Y9
4 4
X8..X5
4
Y8..Y5
4
X4..X1
4
Y4..Y1
4
C17
4-bit // adder
4
C13
4-bit // adder
4
C9
4-bit // adder
4
C5
4-bit // adder
4
C1
S16..S13
S12..S9
S8..S5
S4..S1
S4 .. S1
16-bit parallel adder ripples carry from one 4-bit block to the next. Such ripple-carry circuits are slow because of long delays needed to propagate the carries.
such that: output = Y when S=0 = Y' when S=1 (ii) S connected to carry-in.
Cout
Cin
Analysis: If S=1, then X + (1's complement of Y) +1 appears as the result. If S=0, then X+Y appears as the result.
S4 S3 S2 S1
Revision
y 0 1 0 1
C 0 0 0 1
S 0 1 1 0
S Input bits
X
Y
S
Cout
Sum
Carry
Output bits
S = xy' + x'y
x' y' x y
S = (C+x'y')' C
C x y
S = (x+y)(x'+y')
S=xy C
Revision
Output bits
S Input bits
yz x
A B Cin
S Cout
yz x
Sum Carry
00 01 11 10
1
00 01 11 10
1 1
1 1 1 1 C = xy + xz + yz
x y
xy S = (xy)z xy C = xy + (xy)z
Revision
C4
C5 Binary no. A Binary no. B Input carry FA FA
C3
FA
C2
FA C1
S
S 4-bit sum
S4
S3
S2
S1
Revision
truth table!
X12..X9 Y12..Y9
4 4
X8..X5
4
Y8..Y5
4
X4..X1
4
Y4..Y1
4
C17
4-bit // adder
4
C13
4-bit // adder
4
C9
4-bit // adder
4
C5
4-bit // adder
4
C1
S16..S13
S12..S9
S8..S5
S4..S1
Revision
X4 X3 X2 X1
Z4 Z3 Z2 Z1
Zi = S.Yi' + S'.Yi
When S=0, Cin=0, Zi = Yi S = X + Y When S=1, Cin=1, Zi = Yi' S = X + Y' + 1
Cout
Cin
S4 S3 S2 S1
Comparators
A comparator compares two n-bit values to determine which is greater, or if they are equal.
1-bit Comparator
If they are not equal, no need to compare the other bits. If they are equal, we must check the next bit.
Continue until one number if found to be greater than the other, or all bits are checked and the numbers are found equal.
Classical method requires 22n rows in truth table! How do we compare two 4-bit values A (a3a2a1a0)
and B (b3b2b1b0)? If (a3 > b3) then A > B If (a3 < b3) then A < B If (a3 = b3) then if (a2 > b2) .
A2
B2
x2
A1
B1
A0
B0
(A > B)
(A = B)
x3. x2.x1.x0
4-bit comp
(A < B) (A > B) (A = B)
1 0 0
If inputs are stable at times t1,t2,..,tn, respectively; then the earliest time in which the output will be stable is: max(t1, t2, .., tn) + t
To calculate the delays of all outputs of a combinational circuit, repeat above rule for all gates.
S
t 2t
max(t,2t)+t = 3t
C5
FA
FA
FA
FA
C1
S4
S3
S2
S1
0 0 mt
Full Adder
Si Ci+1
Si
t
max(t,mt)+t max(t,mt)+2t
Ci+1 Ci
mt
as their delay times. Propagation delay of ripple-carry parallel adders is proportional to the number of bits it handles. Maximum Delay: ((n-1)*2+3)t
Faster Circuits
Three ways of improving the speed of these circuits:
(i) Use better technology (e.g. ECL faster than TTL gates),
BUT
(a) faster technology is more expensive, needs more power, lower-level of integrations. (b) physical limits (e.g. speed of light, size of atom).
of-products/product-of-sums) BUT
(a) complicated designs for large circuits. (b) product/sum terms need MANY inputs!
where intermediate signals are labelled as Pi, Gi, and defined as:
Pi = XiYi Gi = Xi.Yi
Ci+1
Pi+1
Ci+2 Gi+1
delay. Can reduce delay by expanding and flattening the formula for carries. For example, Ci+2
Ci+2 = Gi+1 + Pi+1.Ci+1 = Gi+1 + Pi+1.(Gi + Pi.Ci ) = Gi+1 + Pi+1.Gi + Pi+1.Pi.Ci
Also, all carries are two-level sum-of-products expressions, in terms of the generate signals, Gs, the propagate signals, Ps, and the first carry-in, Ci.
Maximum propagation
BCD ADDER
Converts the binary representation of a decimal digit, 0000 to 1001, to the signal needed to show the digit of a 7segment LED display.
Design
This circuit is seven distinct circuits, one for each segment. For each segment we create a K-map, construct the minimal Boolean expression and the logic diagram.
a segment
a = w + xy + xy + yz
b and c segments
b = X2 + X1X0+X1X0
c = X2 + X1 + X0
Diagrams
b = X2 + X1X0+X1X0 c = X2 + X1 + X0