Comb in A To Rial
Comb in A To Rial
Comb in A To Rial
xi yi
X Y
c i+ 1 Cout FA Cin
ci
S
si
Full subtractor
bin x y bout d Comment
0 0 0 0 0 x-bin-y = d = 0-0 = 0
0 0 1 1 1 0-0-1 = borrow 2-1 = 1
0 1 0 0 1 1-0-0=1 with no borrow
0 1 1 0 0 1-0-1=0 with no borrow
1 0 0 1 1 x=0-1=-1 because of bin=1, therefore,
borrow 2-1=1. Finally, 1-0=1
1 0 1 1 0 x-bin-y=borrow 2-1-1=0
1 1 0 0 0 1-1-0=0 with no borrow
1 1 1 1 1 x-bin=1-1=0. Then 0-1=borrow 2-1=1
xy 00 01 11 10 xy 00 01 11 10
b in b in
0 1 3 2 x'y 0 1 3 2
0 1 0 1 1
x'b in
4 5 7 6 4 5 7 6
1 1 1 1 yb in 1 1 1
bin X Y
bout
b out FS b in
c7 c6 c5 c4 c3 c2 c1
co u t FA FA FA FA FA FA FA FA c in
s7 s6 s5 s4 s3 s2 s1 s0
c7 c6 c5 c4 c3 c2 c1 c0
co u t FA FA FA FA FA FA FA FA
f7 f6 f5 f4 f3 f2 f1 f0
S0
S1
M
LE AE LE AE LE AE LE AE
c4 FA c3 FA c2 FA c1 FA c0
Overflow f3 f2 f1 f0
ai bi
M S1 S0 xi Indices
in map S0
0 0 0 ai’ 0, 4 S1
0 0 1 ai bi 13 M
0 1 0 ai 10, 14
0 1 1 ai + bi 7, 11, 15
1 X X ai pass to AE
Truth table
LE
xi
Schematic diagram
M = 0 M = 1
S1 S0 00 01 11 10 00 01 11 10
ai bi
a i bi
0 1 3 2 0 1 3 2
00 1
S0
4 5 7 6 4 5 7 6
01 1 1 S1
12 13 15 14 12 13 15 14
M
11 1 1 1 1 1 1 1
8 9 11 10 8 9 11 10
10 1 1 1 1 1 1
LE
xi = M’S1’ S0’ai’ + M’S1 S0bi + S0 ai bi + S1 ai + Mai
xi
Map representation
Simplified schematic diagram
Carry in signal
c0 – Notice that in the AE functional table, c0 = MS1
Overflow signal
c4 – The carry-out of the most significant bit represents an overflow in the case of unsigned arithmetic.
Overflow – The XOR of the carry-outs of the two most significant bits represents the overflow in the case of 2’s
complement arithmetic.
5.6 Decoders / Demultiplexers
To enable only one of n components.
A1 A0
E A1 A0 C3 C2 C1 C0
0 × × 0 0 0 0 E Decoder
1 0 0 0 0 0 1
3 2 1 0
1 0 1 0 0 1 0
1 1 0 0 1 0 0 C3 C2 C1 C0
1 1 1 1 0 0 0 2-to-4 Decoder
E A2 A0 A0
E
1 0
E E
1 0 1 0
E E E E
1 0 1 0 1 0 1 0
C7 C6 C5 C4 C3 C2 C1 C0
D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 0 1 0 1 0
S S S S 0
S0 1
2
Decoder
3
S0 S1 4
5
S2 6
7
1 0 1 0
S S
S1
1 0
S2 S
y
y
8-to-1 mux implemented with 2-to-1 muxes 8-to-1 mux implemented with a decoder
5.8 Buses
A bus is for connecting several components together, however, only one component can send data to the bus at any
one time.
To construct a bus, use a tristate driver, whose output provides three different values, 0, 1, and Z.
The value Z represents a high-impedance state which can be thought of as a disconnection from the bus.
E0
D
Y E Y
E1
Bus 0 Z
Y 1 D
D
Test G L
X >Y 1
X ≤Y 0
X <Y 1
X ≥Y 0
X ≠Y 1 1
X =Y 0 0
For the n-bit integers X and Y, we compare them one bit at a time, starting with the most significant bit,
0 1 0 0 0 1
8 9 11 10
0 1 0 1 0 1 10 1 1 1 1
0 1 1 0 0 1
0 1 1 1 0 1
1 0 0 0 1 0 G = a1b1’ + a1a0b0’ + b1’a0b0’
1 0 0 1 1 0
1 0 1 0 1 0
1 0 1 1 1 0
1 1 0 0 0 0 a0b0 00 01 11 10
a1b1
1 1 0 1 0 1 0 1 3 2
1 1 1 0 1 0 00 1
1 1 1 1 0 0 4 5 7 6
01 1 1 1 1
12 13 15 14
x1 y1 x0 y0 11 1
8 9 11 10
10
S2 S1 S0 Y Comment
0 0 × D No shift
0 1 × Not used
1 0 0 ShiftLeft(D) Shift left
1 0 1 RotateLeft(D) Rotate left
1 1 0 ShiftRight(D) Shift right
1 1 1 RotateRight(D) Rotate right
d3 d2 d1 d0
Left
Input
Right
Input
1 0
Selector
1 0
S0 Selector
3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
Selector Selector Selector Selector
S1
S2
y3 y2 y1 y0
OR array
0
1
2
3
z A0 4
5
y A1 6
4-to-16 7
x A2 decoder 8
9
w A3 10
11
12
13
14
15
f1 f0
5.13 Programmable Logic Arrays (PLA)
ROMs are not very efficient when we use them to implement sparse functions, i.e. functions with only a small
number of 1’s because in such cases, many of the words in the ROM will have a value of 0, which is a waste of
silicon area.
A PLA differs from a ROM in the address decoder. Instead of a full decoder, PLAs use a programmable decoder call
an AND array.
Use a 4 × 8 × 4 PLA to implement the following two functions:
M S1 S0 b
A3 A2 A1 A0
OR array
0
1
2
3
4
5
6
7
AND array
output
array 0 1
f3 f2 f1 f0
c y