Beruflich Dokumente
Kultur Dokumente
Introduction
☞ A combinational circuit is a logic circuit whose outputs at any time are deter-
mined directly and only from the present input combination.
✏ A combinational circuit performs a specific information-processing op-
eration fully specified logically by a set of Boolean functions.
☞ A sequential circuit is one that employ memory elements in addition to (com-
binational) logic gates—their outputs are determined from the present input
combination as well as the state of the memory cells.
✏ The state of the memory elements, in turn, is a function of the previous
inputs (and the previous state).
✏ Its behavior therefore is specified by a time sequence of inputs and inter-
nal states.
x1 z1
x2 .
Combinational
.
z2
. Logic .
. .
xn Circuit
zm
Analysis Procedure
(b) Partition the circuit into small single-output blocks and label the output
of each block.
(c) Obtain the truth table of the blocks depending on the input variables only.
(d) Proceed to obtain the truth tables for other blocks that depend on previ-
ously defined truth tables.
A • T3
B • • T1
C F1
• T2
• T4
D •
F2
T5
Fig. 3-5 Logic Diagram for Analysis Example
T1 = B 0C
T2 = A0 B
T3 = A +T 1
T4 = T2 D
T5 = T2 +D
F2 = T5
F1 = T3 +T 4
• C
•
X Y Z C C T1 T2 T3 S
0 0 0 0 1 0 0 0 0
0 0 1 0 1 0 1 1 1
0 1 0 0 1 0 1 1 1
0 1 1 1 0 0 1 0 0
1 0 0 0 1 0 1 1 1
1 0 1 1 0 0 1 0 0
1 1 0 1 0 0 1 0 0
1 1 1 1 0 1 1 0 1
Logic Simulation
S
Y
AND3 OR2
OR3
AND2
AND2
INV
AND2
OR3
AND2
Fig. 3-7 Xilinx Foundation Schematic for Binary Adder in Figure 3-6
0.0 20ns 40ns 60ns 80ns 100ns 120ns 140ns
iX Cs
iY Cs
iZ Cs
oS
oC
Fig. 3-8 Waveforms for the Binary Adder Schematic in Figure 3-7
Design Procedure
1. From the specifications, determine the inputs, outputs, and their symbols.
2. Derive the truth table (functions) from the relationship between the inputs
and outputs.
3. Derive the simplified Boolean functions for each output function.
☞ Under certain criteria: number of literals, number of gates, number of
inputs to a gate (fanin), propagation delay, number of interconnections,
fanout, power, etc.
4. Draw the logic diagram.
5. Verify the design.
TABLE 3-3
Truth Table for BCD–to–Seven-Segment
Decoder
A B C D a b c d e f g
0 0 0 0 1 1 1 1 1 1 0
0 0 0 1 0 1 1 0 0 0 0
0 0 1 0 1 1 0 1 1 0 1
0 0 1 1 1 1 1 1 0 0 1
0 1 0 0 0 1 1 0 0 1 1
0 1 0 1 1 0 1 1 0 1 1
0 1 1 0 1 0 1 1 1 1 1
0 1 1 1 1 1 1 0 0 0 0
1 0 0 0 1 1 1 1 1 1 1
1 0 0 1 1 1 1 1 0 1 1
All other inputs 0 0 0 0 0 0 0
☞ The logic-0 denotes that the corresponding segment is turned off, while logic-
1 denotes a turned-on segment.
✏ The don’t-care conditions help minimizing the logic circuit, but they also
produce meaningless displays for the unused input combinations, so they
are all assigned 0 here.
☞ The number of gates can be reduced by sharing the common terms.
x y x y S C
0 0 0 0 S = x0 y + xy0 = x y
HA 0 1 1 0
C = xy
1 0 1 0
C S 1 1 0 1
Figure 2: Half-adder.
xy z x y z S C yz yz
x 00 01 11 10 x 00 01 11 10
0 0 0 0 0 0 1 1 0 1
0 0 1 1 0 1 1 1 1 1 1 1
FA
0 1 0 1 0 S C
C S
0 1 1 0 1
S = x0 y0z + x0 yz0 + xy0z0 + xyz = x y z
1 0 0 1 0
1 0 1 0 1 C = xy + yz + zx
1 1 0 0 1
1 1 1 1 1
Figure 3: Full-adder.
Subtractors
D=x y
1 0 0 1 0
1 0 1 0 0
B = x0 y 1 1 0 0 0
1 1 1 1 1
Ripple-Carry Adders
Consider the n-bit binary addition:
(C n+1 Sn Sn 1 S ) (A A A ) + (B B B );
1 n n 1 1 n n 1 1
☞ S =A B C.
i i i i
☞ Alternatively, C = A B + C (A B ).
i+1 i i i i i
xi yi ci ci+1 si xi yi xi yi
ci 00 01 11 10 ci 00 01 11 10
0 0 0 0 0 0 1 3 2 0 1 3 2
0 0 1 0 1
0 1 0 0 1 0 1 1 0 1
0 1 1 1 0 4 5 7 6 4 5 7 6
1 0 0 0 1
1 0 1 1 0 1 1 1 1 1 1 1
1 1 0 1 0
1 1 1 1 1
+ yi O
si = x i O + ci + yi )
ci+1 = x i y i + ci (x i O
xi yi
X Y
c out Adder c0
ci+1
ci
FA
S
si
x7 y7 x6 y6 x5 y5 x4 y4 x3 y3 x2 y2 x1 y1 x0 y0
c7 c6 c5 c4 c3 c2 c1
cout FA FA FA FA FA FA FA FA c0
s7 s6 s5 s4 s3 s2 s1 s0
i i i
ci+1 = gi +pc i i
ci+3 = gi+2 +p i+2 ci+2 =g +pi+2 i+2 gi+1 +p p i+2 i+1 gi +p p pc i+2 i+1 i i
ci+4 = gi+3 +p i+3 ci+3 =g +pi+3 i+3 gi+2 +p p i+3 i+2 gi+1 +p p p i+3 i+2 i+1 gi +p i+3 pi+2pi+1pi c
☞ Each of the carries has a fixed delay time from the time the carry-generate &
carry-propagate terms are available.
☞ However, be aware that NOT every gate has the same delay time. In general,
gates with a larger number of inputs have longer gate delays.
☞ The fanout of the carry-generate & carry-propagate terms also affects the
overall delay of the adder, so a CLA generator usually is limited to four bits.
Exercise 1
(a) Show that c +4 has a longer delay than c +1 .
i i
(b) Assume each two-input gate has a delay , then what will be the delays for
c +1 and c +4 , respectively, counting from the time the carry-generate & carry-
i i
☞ Roughly, in the worst case an n-bit ripple-carry adder has 2n gate delays, but
an n-bit CLA adder has 4 log4 n gate delays, assuming only 2-input gates.
ci
2.4 2.4 3.2 3.2 2.4 2.4 3.2 2.4 2.4 2.4
ci+4 2.4
2.4
where
g(i;i+3) =g +p i+3 i+3 gi+2 +p i+3 pi+2gi+1 +p i+3 pi+2pi+1gi ;
and
p(i;i+3) =p i+3 pi+2pi+1pi :
c4 = g(0;3) +p (0;3) c0
c8 = g(4;7) +p (4;7) c4
x15 y15 x14 y14 x13 y13 x12 y12 x11 y11 x10 y10 x9 y9 x8 y8 x7 y7 x6 y6 x5 y5 x4 y4 x3 y3 x2 y2 x1 y1 x0 y0
c16 c0
CLA
c12 c8 c4
(b) 2−level CLA generator
Adders/Subtractors
A B
S Function Comment
S
0 A+B addition Adder/Subtractor
c out
1 A + B’+ 1 subtraction
F
(a) Truth table (b) Graphic symbol
a7 b7 a6 b6 a5 b5 a4 b4 a3 b3 a2 b2 a1 b1 a0 b0
c0
FA FA FA FA FA FA FA FA
f7 f6 f5 f4 f3 f2 f1 f0
✯ A logic unit (LU) performs one of several Boolean functions on any two
operands, i.e., S = f (X; Y ). j
✩ The encoding of the selection variables for a given function is such that
S = 1 iff m = 1 for that function.
i i
xi yi
S0 xi yi f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f 10 f 11 f 12 f 13 f 14 f 15
S1 m0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 S0
S2 m1 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 S1
m2 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 S2
S3
m3 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 S3
LU
x7 y7 x6 y6 x5 y5 x4 y4 x3 y3 x2 y2 x1 y1 x0 y0
si
X Y
LU LU LU LU LU LU LU LU
S3
S2
S1 Logic Unit
S0
s7 s6 s5 s4 s3 s2 s1 s0
S
(c) Graphic symbol (d) 8−bit logic unit
Figure 9: An LU that can perform all 16 Boolean functions of two variables [Gajski].
✯ An arithmetic-logic unit (ALU) performs the basic arithmetic and logic op-
erations in a processor.
✩ Arithmetic operations: addition, subtraction, increment, decrement, etc.
✩ Logic operations: AND, OR, identity, complement, etc.
✯ All arithmetic operations are based on addition.
✩ We design the ALU by modifying the inputs of a ripple-carry or CLA
adder.
✩ The modifying logic for arithmetic operations is called an arithmetic ex-
tender (AE).
✩ The modifying logic for logic operations is called a logic extender (LE).
a3 b3 a2 b2 a1 b1 a0 b0
LE AE LE AE LE AE LE AE
x3 y3 x2 y2 x1 y1 x0 y0
c3 c2 c1
c4 FA FA FA FA c0
f3 f2 f1 f0
Example 5
Consider the four-bit ALU with four arithmetic operations (addition, subtraction,
increment, and decrement) and four logic operations (AND, OR, identity, and
complement).
We use mode control variable M : if M = 1 then the ALU performs arithmetic
operations, and if M = 0 then the ALU performs logic operations.
The AE design is shown in Fig. 11; the LE design is shown in Fig. 12; and the
final ALU design is shown in Fig. 13. 2
M S1 S0 Function name F X Y c 0
1 1 1
1 1 0 0 1
1 1 0 1 0 AE
1 1 1 0 0 y i = M S1’bi + M S’0 b’
i
yi
1 1 1 1 0
M S1 S0 xi
M S1 S0 Function name F X Y c0
0 0 0 a ’i
0 0 0 Complement A’ A’ 0 0
0 0 1 a i bi
0 0 1 AND A AND B A AND B 0 0
0 1 0 ai
0 1 0 Identity A A 0 0
0 1 1 a i + bi
0 1 1 OR A OR B A OR B 0 0
1 x x ai
M=0 M=1
S 1 S0
a i bi 00 01 11 10 00 01 11 10 S0
0 1 3 2 16 17 19 18
S1
00 1
4 5 7 6 20 21 23 22
M
1
01 1
12 13 15 14 28 29 31 30
11 1 1 1 1 1 1 1
8 9 11 10 24 25 27 26
10 1 1 1 1 1 1
LE
x i = M’S1’S ’0 a ’i + M’S1 S 0 bi + S 0 a i bi + S1 a i + M a i
xi
(c) Map representation (d) Logic schematic
a3 b3 a2 b2 a1 b1 a0 b0
S0
S1
M
L A L A L A L A
x3 y3 x2 y2 x1 y1 x0 y0
c3 c2 c1
c0
c4 FA FA FA FA
f3 f2 f1 f0
(a) 4−bit ALU
A B
S0
S1
ALU
M
c out
F
(b) Graphic symbol
Code Converter
y z CD CD
Circuit using A B C D w x 00 01 11 10 00 01 11 10
AB AB
BCD code 0 0 0 0 0 0 1 1 00 00 1 1 1
0 0 0 1 0 1 0 0 01 1 1 1 01 1
A B C D
0 0 1 0 0 1 0 1 11 X X X X 11 X X X X
0 0 1 1 0 1 1 0 10 1 1 X X 10 1 X X
Code converter
0 1 0 0 0 1 1 1 w = A + BC + BD x = B 0C + B 0D + BC 0 D0
0 1 0 1 1 0 0 0
w x y z CD CD
0 1 1 0 1 0 0 1 00 01 11 10 00 01 11 10
AB AB
Circuit using 0 1 1 1 1 0 1 0 00 1 1 00 1 1
Excess-3 code 1 0 0 0 1 0 1 1 01 1 1 01 1 1
1 0 0 1 1 1 0 0 11 X X X X 11 X X X X
10 1 X X 10 1 X X
y = CD + C 0D0 z = D0
Figure 14: BCD to excess-3 code conversion.
Decimal 8 3
Binary 3 8
Decimal
World Encoder System Decoder World
A0
E A0 C1 C0
1 0 0 1
Decoder
E
1 0 1 1 1 0
0 x 0 0
C1 C0
(a) Graphic symbol (b) Truth table
A0
C 0 = E A’0 C0
C 1 = E A0 C1
E
☞ The decoder output variables are mutually exclusive because only one output
can be equal to 1 at any time.
☞ The output line whose value is 1 represents the minterm equivalent of the
binary number presently available in the input lines.
☞ A decoder with an enable (E) input is also called a demultiplexer (DMUX or
DEMUX).
☞ Larger decoders can be implemented using smaller decoders.
E E A2 A1 A0
1 0
E
1 0
E E
1 0 1 0
E E
3 2 1 0 3 2 1 0
E E E E
1 0 1 0 1 0 1 0 C7 C6 C5 C4 C3 C2 C1 C0
C7 C6 C5 C4 C3 C2 C1 C0
(b) Implementation with 1−to−2 decoders (c) Implementation with 2−to−4 decoders
D0 = A2 A1 A0
• • •
•
D1 = A2 A1 A0
A0 • • •
D2 = A2 A1 A0
• • •
A1
•
• • D3 = A2 A1 A0
•
• •
• D4 = A2 A1 A0
A2 • •
•
D5 = A2 A1 A0
•
• D6 = A2 A1 A0
•
D7 = A2 A1 A0
Figure 18: Direct implementation of the 3-to-8 decoder [Mano & Kime].
Exercise 2
(a) Show how to implement f1 = ABC + A0C 0 and f =
2 AC 0 + B 0C using a
3-to-8 decoder and 2 OR gates.
(b) Since a NAND gate produces the AND operation with an inverted output, it be-
comes more economical to generate the decoder minterms in their complemented
form. Show how to do that. 2
(
S X; Y; Z ) = (1; 2; 4; 7); C (X; Y; Z ) = (3; 5; 6; 7)
3–to–8
Decoder
0
1
Z 20 S
2
3
Y 21 4
5 C
X 22 6
7 •
2
☞ A function with k > 2 =2 minterms can be expressed in its complement form
n
with 2 n
k minterms.
Multiplexers/Selectors
S1 S0 Y
D3 D2 D1 D0
0 0 D0
3 2 1 0
S1 0 1 D1
Selector
S0
1 0 D2
Y
1 1 D3
S0
S1
D0
Y = S 1’S0’D 0 + S 1’S0 D 1
+ S 1S’0 D2 + S 1S0 D3 D1
Y
D2
D3
I0
I1 .
Y
I2
.
I3 . .
ss1 .
2 4 Decoder
0 .
I = 0.
i
A B C f
0 0 0 0
C
0 0 1 1
I0 C I0
0
II1
C 0 I1 4 1
0 1 0 1 1
C0 1
II23 8 1 Y f
1 I2 MUX Y f
0 1 1 0 0
1
II45 MUX
0 I3
1 0 0 1 1
1 0 1 1
1 0
0 I67 s2 s1 s0 s1 s0
1 1 0 0
0 A B C A B
1 1 1 0
A I0
BCI0 I1 I3 I2 1 I1
A 00 01 11 10 4 1
A0 I2 MUX Y f
0 0 1 0 1
0 I3
1 1
A
1
1
0
0
0
A0 s1 s0
B C
C2 C1 C0 Y
0 0 0 D0
0 0 1 D1
0 1 0 D2
0 1 1 D3
1 0 0 D4
1 0 1 D5
1 1 0 D6
1 1 1 D7
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 0 1 0 1 0
C2
1 0 1 0
C1
1 0
C0
Y
(b) Implementation with 2−to−1 selectors
C2 C1 C0 Y
0 0 0 D0
0 0 1 D1
0 1 0 D2
0 1 1 D3
1 0 0 D4
1 0 1 D5
1 1 0 D6
1 1 1 D7
D7 D6 D5 D4 D3 D2 D1 D0
76543210
C0
Decoder
C1
C2
Y
(b) Implementation with a decoder
Buses
E Y
E
0 Z
D Y
1 D
(a) Tristate driver symbol (b) Truth table for tristate driver
S Bus
S Y
D0
0 D0
Y
D1 1 D1
S1 S0
Decoder
3 2 1 0
Bus S1 S0 Y
0 0 D0
D0
0 1 D1
D1 1 0 D2
Y 1 D3
1
D2
D3
Priority Encoders
output called Any, which will be 1 iff any of the inputs has a value different
from 0.
✯ The outputs A 1; A 2; : : : ; A0 represent the index of the most significant
m m
D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 A2 A1 A0 Any
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 0 1 x 0 0 1 1
0 0 0 0 0 1 x x 0 1 0 1
0 0 0 0 1 x x x 0 1 1 1
0 0 0 1 x x x x 1 0 0 1
0 0 1 x x x x x 1 0 1 1
0 1 x x x x x x 1 1 0 1
1 x x x x x x x 1 1 1 1
(a) Truth table
D7 D6 D5 D4 D3 D2 D1 D0 D 3 D 2D 1D 0
D 7 D 6D 5D 4
1 0 1 0 1 0 1 0
3 2 1 0 3 2 1 0
encoder encoder encoder encoder
encoder encoder
1 0 1 0 1 0 1 0
S S
encoder selector encoder selector
1 0 1 0 1 0
encoder S S
selector selector
1 0 1 0 1 0
S S
encoder selector selector
Any A2 A1 A0
Any A2 A1 A0
(b) Implementation with 2−to−1 encoders and selectors (c) Implementation using 4−to−2 encoders
Magnitude Comparators
A magnitude
A<B
A=B
B comparator
A>B
✯ If A and B are n-bit numbers, then a single combinational circuit module has
22 rows in its truth table, and becomes too cumbersome even with n = 3.
n
xi a b = a b + a0 b0 , i = 0; 1; 2; 3.
i i i i i i
(A = B ) = x x x x 3 2 1 0
(A > B ) = a b0 + x a b0 + x x a b0 + x x x a b0
3 3 3 2 2 3 2 1 1 3 2 1 0 0
(A < B ) = a0 b + x a0 b + x x a0 b + x x x a0 b
3 3 3 2 2 3 2 1 1 3 2 1 0 0
In the last 2 equations, we need the components a b0 and a0 b . However, note that
x = a b = (a b )0 = (a b0 + a0 b )0, i.e., the components can be shared.
i i i i
i i i i i i i i i
Exercise 3
(a) Implement the comparator based on the above algorithm.
(b) How do you extend the algorithm to an arbitrary n? 2
Now let G = 1 when A > B , L = 1 when A < B , and G = L = 0 when A = B .
From the above algorithm, we obtain
Gi = (a i ) ((a = b ) and (G
> bi or i i i 1 > Li 1 ));
Li = (a i < b ) or ((a = b ) and (G
i i i i 1 < Li 1 )):
This leads to regular implementation of magnitude comparators as shown below.
a1 b1
a 1 b1 a 0 b0 G L
0 0 0 0 0 0
0 0 0 1 0 1
0 0 1 0 1 0 G a0
0 0 1 1 0 0
0 1 0 0 0 1
0 1 0 1 0 1
0 1 1 0 0 1
0 1 1 1 0 1
1 0 0 0 1 0
1 0 0 1 1 0
1 0 1 0 1 0
1 0 1 1 1 0 L b0
1 1 0 0 0 0
1 1 0 1 0 1
1 1 1 0 1 0
1 1 1 1 0 0 2−bit comparator
a 0 b0 a 0 b0
a 1 b1 00 01 11 10 a 1 b1 00 01 11 10
0 1 3 2 16 17 19 18
00 1 00 1
4 5 7 6 20 21 23 22
01 01 1 1 1 1
12 13 15 14 28 29 31 30
11 1 11 1
8 9 11 10 24 25 27 26
10 1 1 1 1 10
G7 G6 G5 G2 a1 b1
G4 G3 G1
G G G G G G G a0
L7 L6 L5 L4 L3 L2 L1
L L L L L L L b0
x7 y7 x6 y6 x5 y5 x4 y4 x3 y3 x2 y2 x1 y1 x0 y0
a1 b1 a0
G L b0 G L G L G L
G L G L
G L
✯ A shifter shifts one bit position of its content to the left or right at a time,
taking the input bit from the right or left when it shifts.
✯ A rotator rotates one bit position of its content to the left or right at a time,
routing the output bit back to its input.
S2 S1 S0 Y Comment
0 0 x D no shift
0 1 x not used
1 0 0 shl(D) shift left
1 0 1 rtl(D) rotate left
1 1 0 shr(D) shift right
1 1 1 rtr(D) rotate right
d7 d6 d5 d4 d3 d2 d1 d0
Right
input
Left
input
1 0 1 0
S0
Selector Selector
3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
Selector Selector Selector Selector Selector Selector Selector Selector
S1
S2
y7 y6 y5 y4 y3 y2 y1 y0
Figure 27: An 8-bit shifter for shifting or rotating one bit position to the left or right [Gajski].
✏ For arithmetic left shift, 0’s have to be entered from the right input. In
addition, the MSB must be made the duplicate of the sign bit after the
left shift.
S2 S1 S0 y7 y6 y5 y4 y3 y2 y1 y0
0 0 0 d 7 d6 d5 d4 d3 d2 d1 d0
0 0 1 d 0 d7 d6 d5 d4 d3 d2 d1
0 1 0 d 1 d0 d7 d6 d5 d4 d3 d2
0 1 1 d 2 d1 d0 d7 d6 d5 d4 d3
1 0 0 d 3 d2 d1 d0 d7 d6 d5 d4
1 0 1 d 4 d3 d2 d1 d0 d7 d6 d5
1 1 0 d 5 d4 d3 d2 d1 d0 d7 d6
1 1 1 d 6 d5 d4 d3 d2 d1 d0 d7
d7 d6 d5 d4 d3 d2 d1 d0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
S0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
S1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
S2
y7 y6 y5 y4 y3 y2 y1 y0
Read-Only Memories
A0
n inputs 2n m
A1 n 2n
OR
ROM Decoder
Array
An 1
dimensions.
✏ For example, a 2K ROM may be arranged as 2048 words 1 bit, 512
words 4 bits, 256 words 8 bits, 128 words 16 bits, etc.
☞ Types of ROM:
✏ ROM: mask programmable ROM (costly if quantity is small)
✏ PROM: (field) programmable ROM
✏ EPROM: erasable PROM
✏ EEPROM: electrically erasable PROM
Computational Programmable
symbols symbols
A A B CD
B
C
D
A A B CD
B
C
D
OR array
0
1
2
3
A0 4
5
A1 4−to−16 6
decoder 7
A2 8
9
A3
10
11
12
13
14
15
F3 F2 F1 F0
A3 A 2 A1 A0 F3 F2 F1 F0
ai bi (S) (ai ) (bi ) (ci ) (c )(f i)
i+1
S 0 0 0 0 x x 0 0
0 0 0 1 x x 0 1
0 0 1 0 x x 0 1
0 0 1 1 x x 1 0
0 1 0 0 x x 0 1
0 1 0 1 x x 1 0
0 1 1 0 x x 1 0
0 1 1 1 x x 1 1
FA c i+1 FA c i FA 1 0 0 0 x x 0 1
1 0 0 1 x x 1 0
1 0 1 0 x x 0 0
1 0 1 1 x x 0 1
1 1 0 0 x x 1 0
1 1 0 1 x x 1 1
fi 1 1 1 0 x x 0 1
1 1 1 1 x x 1 0
OR array
0
1
2
3
A0 4
5
A1 4−to−16 6
decoder 7
A2 8
9
A3
10
11
12
13
14
15
F3 F2 F1 F0
Figure 32: An implementation (programming) of the adder/subtractor bit slice using the 16 4
ROM [Gajski].
A3 A 2 A1 A0
OR array
0
1
2
3
4
5
6
7
AND array
0 1
Output array
F3 F2 F1 F0
xi yi
ci 00 01 11 10
0 1 3 2
A3 A 2 A1 A0 F3 F2 F1 F0 1 1
0
xi yi ci s i ci+1
4 5 7 6
x 0 0 0 x x 0 0
x 0 0 1 x x 0 1 1 1 1
x 0 1 0 x x 0 1
x 0 1 1 x x 1 0
x 1 0 0 x x 0 1 00 01 11 10
x 1 0 1 x x 1 0 0 1 3 2
x 1 1 0 x x 1 0 1
x 1 1 1 x x 1 1 0
4 5 7 6
1 1 1 1
(x i) (y i ) (c i )
A3 A 2 A1 A0
OR array
0 x ’i y ’i ci
1 x ’i y i ci’
2 x i y ’i ci’
3 x i y i ci
4 xi yi
5 x i ci
6 y i ci
AND array
0 1
F3 F2 F1 F0
(not used) (si ) (c i+1 )
Fixed Programmable
Inputs Programmable Outputs
AND array
Connections OR array
(decoder)
Programmable Programmable
Inputs Fixed Outputs
Connections AND array OR array