chapter 3 combinational logic by taweesak reungpeerakul
TRANSCRIPT
Chapter 3
Combinational Logic
By Taweesak Reungpeerakul
242-208 CH3 2
Contents Basic Combinational Logic Circuits Implement SOP and POS using Basic
Logic Gates Universal Property of NAND and NOR Combinational Logic using NAND and
NOR Operation with Pulse Waveforms Digital System Application
242-208 CH3 3
3.1 Basic Combinational Logic Circuit
A
Out
B
C
InputsA B C AB AC BC
OUT0 0 0 0 0 0 00 0 1 0 0 0 00 1 0 0 0 0 00 1 1 0 0 1 11 0 0 0 0 0 01 0 1 0 1 0 11 1 0 1 0 0 11 1 1 1 1 1 1
BC
AB
AC
AB+AC+BC
242-208 CH3 4
AND-OR-INV Logic
Invert AND-OR in SOP AND-OR-INV in POS
AB+AC+BC =(A+B)(A+C)
(B+C) A
Out
B
C
A
Out
B
C
242-208 CH3 5
XOR
OUT = AB + AB
A
Out
B
242-208 CH3 6
XNOR
OUT = AB + AB = AB + AB
A
Out
B
242-208 CH3 7
3.2 Implementing Combinational Logic
Ex#1: OUT = ABC+DE Ex#2: OUT = A(BC+DE)
A
Out
B
E
C
D
A
Out
B
E
C
D
242-208 CH3 8
From Truth Table
Truth TableA B C OUT0 0 0 00 0 1 10 1 0 10 1 1 01 0 0 01 0 1 11 1 0 01 1 1 0
A
Out
BC
242-208 CH3 9
Example
Truth TableA B C OUT0 0 0 10 0 1 10 1 0 00 1 1 01 0 0 01 0 1 11 1 0 01 1 1 1
A
Out
BC
TableLogic Circuit Karnaugh Map Simplified Circuit
BCA 0100 1011
1
0 1
11
1
242-208 CH3 10
2.3 Universal Property of NAND&NOR
INV, OR, AND, and NOR created by using NAND gates
A
BAB
A
A+B
B
A
A+B
B
INV
NOR
AND
OR
242-208 CH3 11
Universal Property of NOR
INV, OR, AND, and NAND created by using NOR gates
INV
NAND
AND
OR
AB
A
B
A
B
A+B
A
AB
B
242-208 CH3 12
3.4 Combinational Logic using NAND & NOR
NAND; OUT = AB+CD = AB+CD = (AB)(CD)
A
OUT
B
CD
A
OUT
B
CD
A
OUT
B
CD
242-208 CH3 13
Dual Symbols of NAND
Always use the gate symbols in such a way that every connection between a gate output and a gate input is either bubble-to-bubble or nonbubble-to-nonbubble.
A
OUT
B
C
A
OUTB
CABC AB+C
242-208 CH3 14
Example: implemented by NAND
Ex1: ABC+DE
A
OUT
B
D
E
C
Ex2: ABC+D+E
A
OUT
BC
DE
242-208 CH3 15
Combinational Logic using NOR
NOR; (A+B)(C+D)
= (A+B)(C+D) = (A+B)+(C+D)
A
OUT
B
CD
A
OUT
B
CD
A
OUT
B
CD
242-208 CH3 16
Dual Symbols
(A+B)+C
(A+B)C
A
OUT
B
C
A
OUT
B
C
242-208 CH3 17
3.5 Operation with Pulse Waveforms
A
B
OUT
D
C
A
OutB
A
B
OUT
D
C
C
D
Logic circuit Timing diagram
242-208 CH3 18
Develop logic circuit from waveforms
A
B
OUT
C
AOut
B
C
242-208 CH3 19
Functions of Combinational Logic (Session 2)
Adders Comparators Decoders Encoders Code Converters Multiplexers Demultiplexers
242-208 CH3 20
3.6 Basic Adders
Full AdderA B Cin SUM Cout0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 11 1 0 0 11 1 1 1 1
Half AdderA B SUM Cout
0 0 0 00 1 1 01 0 1 01 1 0 1
SUM = AB
Cout = AB
SUM = ABCin
Cout = AB+(AB)Cin
242-208 CH3 21
Logic Symbol and Diagram
Half Adder Full Adder
B
A
∑
Cout
∑B
A
∑
Cout
∑
Cin
Cout
A
SUMB
Cin
A
SUM
B
Cout
242-208 CH3 22
Full Adder by 2 Half Adders
Half Adder Full Adder
B
A
∑
Cout
∑
A
SUM
B
Cout
SUM = ABCin
Cout = AB+(AB)Cin
B
A
∑
Cout
∑SUM
Cout
B
A
∑
Cout
∑A
B
Cin
AB
AB
242-208 CH3 23
3.7 Parallel Binary Adder
A1 B1
BA
Cout ∑
BA
Cout ∑
Cin
A2 B2
S2 S1S3
A2A1
+B2B1
S3S2S1
A1 B1
BA
Cout ∑
Cin
A2 B2
S2 S1S3
BA
Cout ∑
Cin
A full adder is required for each
bit in the numbers.
Question: 4-bit numbers
242-208 CH3 24
4-bit Parallel Adders
An Bn Cn-1 Sn
Cn0 0 0 0
00 0 1 1
00 1 0 1
00 1 1 0
11 0 0 1
01 0 1 0
11 1 0 0
11 1 1 1
1
C0A1 B1
BA
Cout ∑
Cin
A2 B2
S2 S1
C2
BA
Cout ∑
Cin
A3 B3
BA
Cout ∑
Cin
A4 B4
S4 S3C4
BA
Cout ∑
Cin
C1C3
242-208 CH3 25
IC:4-bit Parallel Adder
Example: 74LS83A (or 74LS283)
74LS83A74LS283
Question: Show circuit diagram of A+B by using 74LS83A. A = 00001111 and B = 01011100
242-208 CH3 26
3.8 Comparators
Equality Comparing A and B: AB
If A=B, output = 0 If A≠B, output = 1
HIGH indicates equality: AB (XNOR)
A1A0 ? B1B0
A1
1 if A=BB1
A0
B0
0 if A¹B
Inequality IC: 74LS85
Question: Show circuit diagram in order to compare two 8-bit numbers by using 74LS85.
A1
A0
A2
A3
B1
B0
B2
B3
Cascading inputs
COMP
A = B
A < B
A > BA = B
A < B
A > B
0
0
3
3
A
B
Outputs
242-208 CH3 27
Two 74LS85 Cascaded Arrangement
Outputs
A1
A0
A2
A3
B1
B0
B2
B3
COMP
A = B
A < B
A > BA = B
A < B
A > B
0
0
3
3
A
A
A5
A4
A6
A7
B5
B4
B6
B7
+5.0 V
COMP
A = B
A < B
A > BA = B
A < B
A > B
0
0
3
3
A
A
LSBs MSBs
242-208 CH3 28
74HC85 Truth Table
242-208 CH3 29
3.9 Decoders
A decoder is a logic circuit that detects the presence of a specific combination of bits at its input.
A1
A0
A2
A3
OUT A1
A0
A2
A3
OUT
Active HIGH decoder for 0011 Active LOW decoder for 0011
242-208 CH3 30
4-to-16 Decoder
Bin/Dec
A0
0123456789
101112131415
4-bit binaryinput
Decimaloutputs
A1
A2
A3
1
1
0
1111111111101111
1
15
1213
14
1
23
4
910
11
56
7
8
0
&
48
1
2
IC: 74HC154
A0A1A2
A3
CS1
CS2
Question: Use 74HC154 to implement the logic in order to support a 5-bit number.
242-208 CH3 31
BCD-to-Decimal Decoder BCD-to-decimal decoders accept a binary coded decimal
input and activate one of ten possible decimal digit indications.
IC: 74HC42BCD/DEC
012
3456789
12
48
74HC42
(11)(10)(9)(7)(6)(5)(4)(3)(2)
(1)
(15)(14)(13)(12)
A1
A0
A2
A3
Question: Assume the inputs to the 74HC42 decoder are the sequence 0101, 0110, 0011, and 0010. Describe the output.
Answer: All lines are HIGH except for one active output, which is LOW. The active outputs are 5, 6, 3, and 2 in that order.
Question: Write truth table of output 0.
242-208 CH3 32
BCD-to-7-Segment Decoder
IC: 74LS47 BCD Inputs (D-A) 7-segment Outputs (a
-g) Ripple Blanking Input
(RBI) Blanking Input/Ripple
Blanking Output (BI/RBO)
Lamp Test (LT) Zero Suppression
a
b
c
d
e
f
g
1
2
4
8
(16)
(4)
(13)
(12)
(11)
(10)
(9)
(15)
(14)
(1)
(2)
(6)
(7)
(3)
(5)
(8)
BCD inputs
Outputs to seven segment device
GND
VCC
BCD/7-seg
BI/RBO BI/RBO
LT
RBI
LT
RBI
74LS47
242-208 CH3 33
Illustration of Leading Zero Suppression
abcdefg BI/RBO
0 0 0 0
8 4 2 1RBI LT
0
74LS47
abcdefg BI/RBO
0 0 0 0
8 4 2 1RBI LT
0
74LS47
abcdefg BI/RBO
0 0 1 1
8 4 2 1RBI LT
0
74LS47
abcdefg BI/RBO
0 0 0 0
8 4 2 1RBI LT
1
74LS47
242-208 CH3 34
Illustration of Trailing Zero Suppression
abcdefg BI/RBO
0 1 0 1
8 4 2 1RBI LT
74LS47
1
abcdefg BI/RBO
0 1 1 1
8 4 2 1RBI LT
74LS47
abcdefg BI/RBO
0 0 0 0
8 4 2 1RBI LT
74LS47
0
abcdefg BI/RBO
0 0 0 0
8 4 2 1RBI LT
74LS47
0
242-208 CH3 35
3.10 Encoders
An encoder accepts an active logic level on one of its inputs representing a digit, such as a decimal or octal digits, and converts it to a coded output, such as BCD or binary.
IC: 74HC147 16-to-4 encoder (decimal-to-BCD)
IC: 74F148 8-to-3 encoder
A1
A0
A2
A3
1
2
3
45678
9
242-208 CH3 36
Example Show how the decimal-to-BCD encoder
converts the decimal number 3 into a BCD 0011.
A1
A0
A2
A3
1
2
3
45678
9
0
0
0
00
0
0
0
1
0
0
1
1
242-208 CH3 37
74HC147
The 74HC147 is an example of an IC encoder. It has ten active-LOW inputs and converts the active input to an active-LOW BCD output.
This device offers additional flexibility with a priority encoder.
Decimal input
BCD output
1
2
4
8
(16)
(11)
(12)
(13)
(1)
(2)
(4)
(3)
(5)
(9)
(7)
(6)
(14)
(8)
1
2
3
4
5
6
7
8(10) 9
GND
VCC
HPRI/BCD
74HC147
242-208 CH3 38
A Simplified Keyboard Encoder
123456789
1248
987
65
321
0
4
R7 R8 R9
R4 R5 R6
R1 R2 R3
R0
BCD complement of key press
The zero line is not needed by the encoder, but may be used by other circuits to detect a key press.
VCC
242-208 CH3 39
3.11 Code Converters BCD-to-BIN
Conversion IC: 74184
BIN-to-BCD Conversion
IC: 74185
242-208 CH3 40
Code Converters (cont.) BIN-to-Gray Gray-to-BIN
MSB
LSB
MSB
LSB
B0 G0
B3
B2
B1
B0
G3
G2
G1
G0
G3
G2
G1
B3
B2
B1
Question: Show the conversion of binary 0111 to Gray and vice versa.
242-208 CH3 41
3.12 Multiplexers (MUX)
A multiplexer has several data-input lines and a single output line.
It also has data-select inputs, which permit digital data on any one of the inputs to be switched to the output line.
Another name is a data selector.
IC: 74HC157 Quad 2-input MUX
IC: 74HC151 8-input MUX
MUX
1
2
0
3
1
0Data select
Data inputs
Data outputD1
D0
D2
D3
S1
S010
Question: Which data line is selected if S1S0 = 10?
242-208 CH3 42
ICs 74HC157 Quad 2-input
MUX
74HC151 8-input MUX
242-208 CH3 43
Y1
Y2
Y3
Y4
Y5
Y6
Y7
Y0
DEMUX
AAA
0
1
2
GGG
1
2A
2B
3.13 Demultiplexers (DEMUX)
A DEMUX basically reverses the multiplexing function.
It takes data from one input line and distributes to one of output lines depending on the select lines.
Another name is a data distributor.
IC: 74LS138 8-output DEMUX
10
Question: Which data output is selected if A2A1A0 = 010?
74LS138
Data select lines
Enable
inputs
Data outputs
0
242-208 CH3 44
Example (DEMUX)
Determine the outputs, given the inputs shown.
A0
Y0
Y1
Y2
Y3
Y4
Y5
Y6
Y7
A1
A2
G1
G2A
G2B
LOW
LOW
74LS138
Y1
Y2
Y3
Y4
Y5
Y6
Y7
Y0
DEMUX
AAA
0
1
2
GGG
1
2A
2B
Data select lines
Enable
inputs
Data outputs