Professional Documents
Culture Documents
Combinational Circuits
Outlines
◼ Introduction
◼ Combinational Circuit Analysis
◼ Combinational Circuit Design
◼ Binary Adders and Subtractors
◼ Binary Decoders and Encoders
◼ Magnitude Comparator
◼ Binary Multiplexers
◼ Three-state Gates
T2
T1 f
T3
y = C’D’+ CD z = D’
3/9/2020 COE211: Digital Logic Design 15
Example 2 (Cont.)
A B C D Step 4: Circuit Drawing
w = A + BC + BD
w
y = CD + C’D’
y
z = D’ z
3/9/2020 COE211: Digital Logic Design 16
Binary Adders and Subtractors
1 1 1 Ci+1 Ci
A 0 1 0 1 Ai
B 0 1 1 1 +Bi
1 1 0 0 Si
Each bit position creates a sum and carry
= z (x’ y’ + x y ) + z’ (x’ y + x y’ ) = z (x y ) + z’ (x y )
= z (x y )’ + z’ (x y ) = z x y
C = xy + x’yz + xy’z
= xy+ z (x’y+ xy’)
= xy + z (x y)
Therefore, the final equations are:
S =zxy
C = xy + z (x y)
3/9/2020 COE211: Digital Logic Design 22
Full Adder (cont.)
S =zxy and C = xy + z (x y)
Therefore, the full adder can be constructed from two half adders
and an OR gate.
C4 S3 S2 S1 S0
3/9/2020 COE211: Digital Logic Design 25
Adder-Subtractor
▪ 4-bit Adder-subtractor (with overflow detection).
➢ When C0 = 0, the circuit is used as an Adder.
➢ When C0 = 1, the circuit is used as a Subtractor.
C0
00 01 11 10 00 11
0010 0011 1110 1101 0010 1110
0011 0110 1101 1010 1100 0100
-------- -------- -------- -------- -------- --------
0101 1001 1011 0111 1110 0010
+2 +3 -2 -3 2 -2
+3 +6 -3 -6 -4 +4
5 -7 -5 7 -2 2
OFL OFL
3/9/2020 COE211: Digital Logic Design 27
Summary
▪ Addition and subtraction are fundamental to computer
systems
▪ Create a single bit adder/subtractor
➢ Chain the single-bit hardware together to create bigger designs
▪ The approach is called ripple-carry addition
➢ Can be slow for large designs
▪ Overflow is an important issue for computers
➢ Processors often have hardware to detect overflow
n Binary 2n
inputs Decoder outputs
D3 = AB
A B D0 D1 D2 D3
0 0 1 0 0 0
0 1 0 1 0 0 A B
1 0 0 0 1 0 Note: Each output is a 2-variable
1 1 0 0 0 1 minterm (A’B', A’B, AB' or AB)
x y z D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
D0
A
2-to-4 D1
B D2
Decoder D3
x y z C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
2n . Binary . n
. Encoder .
inputs . . outputs
D0
D1 x = D4 + D5 + D6 + D7
D2
D3
y = D2 + D3 + D6 + D7
D4 Note: At any one time,
D5 only one input line has
D6 a value of 1.
D7 z = D1 + D3 + D5 + D7
Alarm Contoller
Signal Response
Machine 1
Machine 2 Machine
Code
Encoder Controller
Machine n
▪ A<B
➢ The same as A > B but A and B are exchanged.
➢ (A<B) = A’3 B3 + x3 A’2 B2 + x3 x2 A’1 B1 + x3 x2 x1 A’0 B0
▪ (A = B) = x3 x2 x1 x0
➢ Function table
y I0 = Z
x
I1 = z'
z
z' I2 = 0
0
1 I3 = 1
➢ Set “data” input lines of multiplexer to function values
➢ Connect input variable to “select” inputs
➢ Set the inputs of multiplexer.
3/9/2020 COE211: Digital Logic Design 49
Implementing a 4-Input Function with a MUX
▪ Example: Implement the Boolean function F(A, B, C, D)
= ∑(1, 3, 4, 11, 12, 13, 14, 15) using 8 x 1 MUX.
S2 S1 S0
C
I0 = D B
I1 = D A
I2 = D'
I3 = 0
I4 = 0
I5 = D
I6 = 1
I7 = 1
3/9/2020 COE211: Digital Logic Design 50
Three-state Gate
▪ Two examples