Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

5 Combinatorial Components

Use for data transformation, manipulation, interconnection, and for control:


• arithmetic operations - addition, subtraction, multiplication and division.
• logic operations - AND, OR, XOR, and NOT.
• comparison operations - greater than, equal to, and less than.
• bit manipulation operations - shift, rotation, extraction, and insertion.
• interconnect components - selectors, and buses - used to connect different components together.
• conversion components - decoders and encoders - used for conversion between different codes.
• universal components - ROMs and programmable-logic arrays (PLAs) - used primarily in the design of
control units.

5.0 Full adder


xi yi ci ci+1 si i = xi' yi' ci + xi' yi ci' + xi yi' ci' + xi yi ci
0 0 0 0 0 = (xi' yi + xi yi') ci ' + (xi' yi' + xi yi) ci
0 0 1 0 1 ~
= (xi ⊕ yi) ci' + (xi yi) ci
0 1 0 0 1 = (xi ⊕ yi) ⊕ ci
0 1 1 1 0
1 0 0 0 1 ci+1 = xi' yi ci + xi yi' ci + xi yi ci' + xi yi ci
1 0 1 1 0 = xi yi (ci' + ci) + ci (xi' yi + xi yi')
1 1 0 1 0 = xi yi • 1 + ci (xi ⊕ yi)
1 1 1 1 1

xi yi

X Y

c i+ 1 Cout FA Cin
ci
S

si

Circuit for Full Adder

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

d = x ′y ′bin + xybin + x ′ybin′ + xy ′bin′


= bin ( x ′y ′ + xy) + bin′ ( x ′y + xy ′)
bout = x′bin + x′y + ybin
= bin ( x ⊕ y ) ′ + bin′ ( x ⊕ y )
= bin ⊕ x ⊕ y
x y

bin X Y

bout
b out FS b in

Circuit for Full Subtractor

5.1 Ripple-carry adders


x7 y7 x6 y6 x5 y5 x4 y4 x3 y3 x2 y2 x1 y1 x0 y0

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

5.3 Adder / Subtractor


x7 y7 x6 y6 x5 y5 x4 y4 x3 y3 x2 y2 x1 y1 x0 y0
S S Function Comment
0 X+Y Addition
1 X+Y’+1 Subtraction

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

5.4 Logic Unit


5.5 Arithmetic-Logic Unit (ALU)
a3 b3 a2 b2 a1 b1 a0 b0

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

Arithmetic Extender (AE)


The AE modifies the second operand and passes it to the FA to perform the arithmetic.

M S1 S0 Function Name Function X Y c0


1 0 0 Decrement A–1 A all 1’s 0
1 0 1 Add A+B A B 0
1 1 0 Subtract A+B’+1 A B’ 1
1 1 1 Increment A+1 A all 0’s 1
Functional table
bi
S1 S0 00 01 11 10
bi
M S1 S0 bi yi
0 1 3 2
1 0 0 0 1 0 1 1
1 0 0 1 1 S' 0 b' i S0
4 5 7 6
1 0 1 0 0 1 1 1 S' 1 b i S1
1 0 1 1 1 M
1 1 0 0 1
1 1 0 1 0 yi = MS1’bi + MS0’bi’
1 1 1 0 0
1 1 1 1 0 Map representation
Truth table AE
yi
yi = MS1’S0’bi’ + MS1’S0’bi + MS1’S0bi + MS1S0’bi’
= MS0’bi’(S1’ + S1) + MS1’bi(S0’+ S0) Schematic diagram
= MS0’bi’ + MS1’bi
Logic Extender (LE)
The logic operations are performed in the logic extender. The FAs are used simply as connections for the
outputs.

M S1 S0 Function Name Function X Y c0


0 0 0 Complement A’ A’ 0 0
0 0 1 AND A AND B A AND B 0 0
0 1 0 Identity A A 0 0
0 1 1 OR A OR B A OR B 0 0
Functional table

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

3-to-8 decoder implemented with 1-to-2 decoders

5.7 Selectors / Multiplexers (MUX)


D3 D2 D1 D0
S1 S0 Y
3 2 1 0
0 0 D0 S1
MUX
0 1 D1 S0
1 0 D2
1 1 D3 Y
4-to-1 MUX

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

5.9 Priority Encoders


A priority encoder has:
• n inputs, Dn-1, … D0,
• m outputs, Am-1, … A0, where n = 2m, which represents the index (decimal value) of the most significant
input bit Di that has a value equal to 1.
• an additional output call Any, which will be 1 whenever any of the inputs has a value that is different from
0.

2-to-1 priority encoder


D1 D0
D1 D0 A0 Any
1 0 0 0 0 0
Encoder 0 1 0 1
1 X 1 1
Any A0

4-to-2 priority encoder


D3 D2 D1 D0 A1 A0 Any
D3 D2 D1 D0
0 0 0 0 0 0 0
3 2 1 0 0 0 0 1 0 0 1
Encoder 0 0 1 X 0 1 1
0 1 X X 1 0 1
Any A1 A0 1 X X X 1 1 1

5.10 Magnitude Comparators


A comparator compares two positive integers X and Y and then generates two boolean results G and L as follows:

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,

Gi = (xi > yi) or [(xi = yi) and (Gi-1 > Li-1)]


Li = (xi < yi) or [(xi = yi) and (Gi-1 < Li-1)]
a0b0 00 01 11 10
a1b1
x1 y1 x0 y0 G L 0 1 3 2
00 1
0 0 0 0 0 0
0 0 0 1 0 1 4 5 7 6
01
0 0 1 0 1 0
0 0 1 1 0 0 11
12 13 15
1
14

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

G L = a1’b1 + a1’a0’b0 + b1a0’b0

5.11 Shifters and Rotators


Use selectors to implement.

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

5.12 Read-Only Memories


ROMs can be thought of as a universal logic element that is able to implement concurrently several different
Boolean functions that are defined on the same set of variables.
A 16 × 4 ROM can implement 4 functions.
Programmable ANDs and ORs.
a a b c d
b
c =
d
a a b c d
b
c =
d
Use a 16 × 4 ROM to implement the following two functions:

f0 = w x' y' z + w x' y z' + w' x y' z'


f1 = x y + w' z + w x' y

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:

f0 = w x' y' z + w x' y z' + w' x y' z'


f1 = w' x y + w y' z

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

You might also like