Professional Documents
Culture Documents
Design Methods/Arithmetic
Circuits
Introduction
Analysis Procedure
Design Methods
Gate-level (SSI) Design
Half Adder
Full Adder
BCD-to-Excess-3 Code Converter
Block-Level Design
4-bit Parallel Adder
BCD-to-Excess-3 Code Converter
16-bit Parallel Adder
4-bit Parallel Adder cum Subtractor
Combinational Circuits:
Design Methods/Arithmetic
Circuits
Arithmetic Circuits
Adders
Parallel Adders
Cascading Adders
Parallel Adder-Subtractor
Comparator
Propagation Delays
Calculations of Circuit Delays
Faster Circuits
Look-Ahead Carry Adder
Introduction
Two classes of logic circuits:
combinational
sequential
Combinational Circuit:
Memory
Output depends on both present and past inputs.
Memory (via feedback loop) contains past
information.
Analysis Procedure
Given a combinational circuit, can you analyze its
function?
A A+B
B F1 = (A+B).(A'+B')
F2 = (A'+B')' = A.B
A'+B'
A B (A+B) (A'+B') F1 F2
Steps: 0 0 0 1 0 0
1. Label the inputs and outputs. 0 1 1 1 1 0
1 0 1 1 1 0
2. Obtain the functions of 1 1 1 0 0 1
intermediate points and the outputs.
3. Draw the truth table.
4. Deduce the functionality of the circuit ➜ half adder.
Design Methods
Different combinational circuit design methods:
Gate-level method (with logic gates)
Block-level design method
C
Gate-level (SSI) Design: Full Adder
Half-adder adds up only two bits.
To add two binary numbers, we need to add 3
bits (including the carry).
Example: 1
0
1
0
1
1 1
carry
X
+ 0 1 1 1 Y
1 0 1 0 S
Need Full Adder (so called as it can be made from two half-
adders).
X
Full S
Y
Z
Adder C
(X + Y + Z)
Gate-level (SSI) Design: Full Adder
Truth table:
X Y Z C S
Note:
0 0 0 0 0
0 0 1 0 1 Z - carry in (to the current
0 1 0 0 1 position)
0 1 1 1 0 C - carry out (to the next position)
1 0 0 0 1
1 0 1 1 0 C
YZ
1 1 0 1 0 X
00 01 11 10
1 1 1 1 1 0 1
1 1 1 1
Using K-map, simplified SOP form:
C = XY + XZ + YZ S
YZ
S = X'Y'Z + X
00 01 11 10
X'YZ'+XY'Z'+XYZ 0 1 1
1 1 1
Gate-level (SSI) Design: Full Adder
Alternative formulae using algebraic manipulation:
C = XY + XZ + YZ
= XY + (X + Y)Z
= XY + ((X⊕Y) + XY)Z
= XY + (X⊕Y)Z + XYZ
= XY + (X⊕Y)Z
(X⊕Y)
X
Y S
(XY)
Z
Full Adder made from two Half-Adders (+ OR gate).
Gate-level (SSI) Design: Full Adder
Circuit for above formulae:
C = XY + (X⊕Y)Z
Block diagrams.
S = (X⊕Y)⊕Z
X (X⊕Y)
X Sum X
Y Y Sum S
Y
Half Half
Adder Adder
(XY)
Carry Carry
C
Z
Full Adder made from two Half-Adders (+ OR gate).
Code Converters
Code converters – take an input code, translate to its
equivalent output code.
W D X D
Y = CD + C'D'
CD C CD C
A 00 01 11 10 A 00 01 11 10
B
00 1 1 B
00 1 1 Z = D'
01 1 1 01 1 1
B B
11 X X X X 11 X X X X
A A
10 1 X X 10 1 X X
Y D Z D
Block-Level Design Method
More complex circuits can also be built using block-
level method.
In general, block-level design method (as opposed to
gate-level design) relies on algorithms or formulae of
the circuit, which are obtained by decomposing the
main problem to sub-problems recursively (until
small enough to be directly solved by blocks of
circuits).
Simple examples using 4-bit parallel adder as
building blocks:
(1) BCD-to-Excess-3 Code Conversion
(2) 16-Bit Parallel Adder
(3) Adder cum Subtractor
4-bit Parallel Adder
Consider a circuit to add two 4-bit numbers together
and a carry-in, to produce a 5-bit result:
X4 X3 X2 X1 Y4 Y3 Y2 Y1
4-bit
C5 C1
Parallel Adder
C5 FA FA FA FA C1
S4 S3 S2 S1
Input
Output
Parallel Adders
Note that carry propagated by cascading the carry
from one full adder to the next.
Called Parallel Adder because inputs are presented
simultaneously (in parallel). Also, called Ripple-Carry
Adder.
BCD-to-Excess-3 Code Converter
Excess-3 code can be BCD Excess-3
converted from BCD code 0
A
0
B C
0 0
D
0
W X Y Z
0 0 1 1
using truth table: 1 0 0 0 1 0 1 0 0
2 0 0 1 0 0 1 0 1
3 0 0 1 1 0 1 1 0
Gate-level design can be used 4 0 1 0 0 0 1 1 1
5 0 1 0 1 1 0 0 0
since only 4 inputs. 6 0 1 1 0 1 0 0 1
7 0 1 1 1 1 0 1 0
However, alternative design 8 1 0 0 0 1 0 1 1
possible. 9
10
1
1
0 0
0 1
1
0
1 1 0 0
X X X X
11 1 0 1 1 X X X X
Use problem-specific formulae: 12 1 1 0 0 X X X X
13 1 1 0 1 X X X X
Excess-3 Code 14 1 1 1 0 X X X X
= BCD Code + 15 1 1 1 1 X X X X
(0011)2
BCD-to-Excess-3 Code Converter
Excess-3 Code = BCD Code + (0011)2
Block-level circuit: unused
Cout
X4
BCD X3
4-bit Parallel
code X2 S4
Adder
X1 S3 Excess-3
0 Y4 S2 code
0 Y3 S1
1 Y2
1 Y1 Cin
A BCD-to-Excess-3
Code Converter 0
16-bit Parallel Adder
Larger parallel adders can be built from smaller ones.
Example: a 16-bit parallel adder can be constructed
from four 4-bit parallel adders:
X16..X13 Y16..Y13 X12..X9 Y12..Y9 X8..X5 Y8..Y5 X4..X1 Y4..Y1
4 4 4 4 4 4 4 4
4 is a shortened
notation for
S4 .. S1 S4 S3 S2 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.
4-bit Parallel Adder cum
Subtractor *Optional
Subtraction can be performed through addition using
2s-complement numbers.
Hence, we can design a circuit which can perform
both addition and subtraction, using a parallel adder.
X4 X3 X2 X1 Y4 Y3 Y2 Y1
Y Y Y Y'
S=0 S=1
S
X4 X3 X2 X1
x
y' x'
S = xy' + x'y y'
x' S = (C+x'y')'
y x
y C
x
y C
x
y x
S=x⊕ y
S = (x+y)(x'+y') y
x'
y'
C
x
y C
Arithmetic Circuits: Adders
Revision
Full adder x
0
y
0
z
0
C
0
S
0
Σ
0 0 1 0 1 A Σ Sum
Input Output
0 1 0 0 1 B
0 1 1 1 0 bits Cout Carry bits
Cin
1 0 0 0 1
1 0 1 1 0 yz yz
X' 1 1 0 1 0 00 01 11 10 00 01 11 10
y' x x
z 1 1 1 1 1 0 1 0 1 1
x'
y 1 1 1 1 1
z' 1C = xy + xz + yz 1 + x'yz' + xy'z' + xyz
S S = x'y'z
x
y'
z'
x
y
z x x⊕y
y S = (x⊕y)⊕z
x
xy
y
C = xy + (x⊕y)z
x
z C z
y
z
Arithmetic Circuits: Parallel
Adders Revision
Example: Adding two 4-bit numbers
Subscript i 4 3 2 1 2 ways:
Input carry 0 1 1 0 Ci
Augend 1 0 1 1 Ai ◆ Serial (one FA)
Addend 0 0 1 1 Bi ◆ Parallel (n FAs for n bits)
Sum 1 1 1 0 Si
Output carry 0 0 1 1 Ci+1
Y4 X4 Y3 X3 Y2 X2 Y1 X1
C4 C3 C2
C5 FA FA FA FA C1
Binary Σ
no. A X 4-bit S4 S3 S2 S1
S sum
Binary
no. B Y
Cout Output carry
Input carry Cin
Arithmetic Circuits: Cascading
Adders Revision
4-bit parallel adder:
cascade 4 full adders
classical method: 9 input variables ➔ 29 = 512 rows in truth
table!
Σ
Voter 1 A Σ 1 Σ
2
Voter 2 B 3 A 1
Cout 4 2
3-bit
Voter 3 Cin S 3 Output
1 4
Full-adder 1 2
B
3
4 Cout
Σ
Cin
Voter 4 A Σ
Parallel adder
Voter 5 B
Cout
Voter 6 Cin
Full-adder 2
Arithmetic Circuits: Adder-
Subtractor Revision
Make use of 2’s complement:
X - Y = X + (-Y)
2’s complement of Y = Inverting bits in Y and plus 1.
Y4 Y3 Y2 Y1
S
X4 X3 X2 X1 Zi = S.Yi' + S'.Yi
Z4 Z3 Z2 Z1
(A < B)
A1
x1
A3.B3' + x3.A2.B2'
B1
+ x3.x2.A1.B1'
+ x3. x2.x1.A0.B0'
A0
x0 (A > B)
B0
(A = B)
x3. x2.x1.x0
Arithmetic Circuits: Comparator
0 A3 4-bit
1 A2 comp
1 A1
0 A0
1 B3 (A < B) 1
0 B2 (A > B) 0
1 B1 (A = B) 0
0 B0
Input Output
H
Input
L
H
Output
L
tPHL tPLH
Propagation Delay
A B C
1 1
0 Signal for B 0 Signal for B
1 1
Signal for C Signal for C
0 0
time time
Calculation of Circuit Delays
Amount of propagation delay per gate depends on:
(i) gate type (AND, OR, NOT, etc)
(ii) transistor technology used (TTL,ECL,CMOS etc),
(iii) miniaturisation (SSI, MSI, LSI, VLSI)
t 2t max(t,2t)+t = 3t
C
0
Z
0
C5 FA FA FA FA C1
S4 S3 S2 S1
Calculation of Circuit Delays
Analyse the delay for the repeated block:
Xi 0 where Xi, Yi are
Full Si stable at 0t, while
0
Yi
mt Adder Ci+1 Ci is assumed to
Ci be stable at mt.
Performing the delay calculation gives:
Xi 0 max(0,0)+t = t
max(t,mt)+t
Yi 0 Si
t max(t,mt)+t
max(t,mt)+2t
Ci+1
mt
Ci
Calculation of Circuit Delays
Calculating:
When i=1, m=0: S1 = 2t and C2 = 3t.
When i=2, m=3: S2 = 4t and C3 = 5t.
When i=3, m=5: S3 = 6t and C4 = 7t.
When i=4, m=7: S4 = 8t and C5 = 9t.
In general, an n-bit ripple-carry parallel adder will
experience:
Sn = ((n-1)*2+2)t
Cn+1 = ((n-1)*2+3)t
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).
(ii) Use gate-level designs to two-level circuits! (use sum-
of-products/product-of-sums) BUT
(a) complicated designs for large circuits.
(b) product/sum terms need MANY inputs!
Pi+1
Ci+2
Gi+1