You are on page 1of 23

15-Sep-20

Chapter 8

COMBINATIONAL
LOGIC CIRCUITS

Concepts

 Combinational circuit has


diagram as shown
 There are n inputs: x1, x2,
…, xn
 There are m outputs: y1, y2,
…, ym
 Each output is a function of
the inputs
 Characteristics: when the
input changes, the output
changes immediately.

1
15-Sep-20

Designing Combinational Logic Circuits

 Design steps
 Interpret the problem
 Define the inputs and outputs
 Make true table
 Defines the Boole function of outputs and simplify
 Draw logic circuit

Encoder and Decoder

 Encoder
 There are N (N <= 2n) inputs
 n outputs
 There is only one active input at a time
 Active input index determines the combination of
outputs.
X0
 Example: 4 to 2 encoder
X1 Y0
 Block diagram X2
X3 Y1

2
15-Sep-20

 Encoder (cont) X3 X2 X1 X0 Y1 Y0
 True table 0 0 0 1 0 0
 Boole function 0 0 1 0 0 1
 Logic circuit 0 1 0 0 1 0
1 0 0 0 1 1

 Priority Encoder: encoder has a priority function.


If there are more than 1 active inputs at the same
time, the input with higher priority determines the
output.
 Example: 4 – 2 priority encoder (x0 highest
priority)
X0
 Block diagram
X1 Y0
X2
X3 Y1

3
15-Sep-20

 True table X3 X2 X1 X0 Y1 Y0
 Boole function x x x 1 0 0
 Logic circuit x x 1 0 0 1
x 1 0 0 1 0
1 0 0 0 1 1

 Introduction to ICs
 74147 : Priority encoding from 10 to 4, the inputs and outputs
are both active low.
 74148: Priority encoding from 8 to 3

4
15-Sep-20

True table of 74147

Decimal inputs BCD ouptut


(active low) (active low)
1 2 3 4 5 6 7 8 9 A B C D
1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1 1 1 1 1 0
x 0 1 1 1 1 1 1 1 1 1 0 1
x x 0 1 1 1 1 1 1 1 1 0 0
x x x 0 1 1 1 1 1 1 0 1 1
x x x x 0 1 1 1 1 1 0 1 0
x x x x x 0 1 1 1 1 0 0 1
x x x x x x 0 1 1 1 0 0 0
x x x x x x x 0 1 0 1 1 1
x x x x x x x x 0 0 1 1 0

True table of 74148

5
15-Sep-20

 Decoder (mạch giải mã)


 Contrast encoder: turns the n-bit input into N-bit
output
 Each output is active only for 1 combination of inputs
 Example: Decoding 2 to 4, output active is high
 Block diagram
 Truth table (next page)

Decoders

 A decoder accepts a set of inputs that represents a


binary number—activating only the output that
corresponds to the input number
For each of these
input combinations,
only one of the M
outputs will be active
(HIGH); all the other
outputs are LOW.

Many decoders are designed to produce active-LOW outputs,


where only the selected output is LOW while all others are
HIGH

6
15-Sep-20

 Boole function

 True table

X1 X0 Y3 Y2 Y1 Y0
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0

 Example: 2 to 4 decoder circuit, active output low


 Block diagram
 Table of facts
 Boole function
 Diagram (self-drawing)

7
15-Sep-20

 Example: 2 to 4 decoder circuit has active low


output, 1 active low control input.
 Block diagram
 Table of facts
 Boole function
 Diagram (self-drawing)

 Introduction to ICs
 74LS139 : consist of 2 (2 – 4) decoders
 74LS138 : 3-8 decoder

8
15-Sep-20

True table of 74LS138

 Connect multiple decoder: can connect 2 decoder


n - 2n to get the decoder (n + 1) - 2n + 1
 Example: connect 2 (2 to 4) decoders for 3 to 8
decoder

9
15-Sep-20

Use the decoder to implement the Boole function

 Use the decoder to implement the Boole function


 Example: Using 74138 and the necessary logic gates,
implement the following functions:

 Solution: rewrite functions as following

 And implement using the following circuit

10
15-Sep-20

Multiplexer and Demultiplexer

 MUX = Multiplexer
 Block diagram
 There are 2n inputs
 There is 1 output
 There are n control inputs
 May be has CS input
 Only 1 at a time,
only 1 input connected
to the output, a combination
of control inputs determines the output.

 A multiplexer (MUX) selects 1 of N input data


sources and transmits the selected data to a single
output—called multiplexing.
 A digital multiplexer or data selector is a logic circuit
that performs the same task.

Routing control of desired data


input to output by SELECT
inputs—referred to as
ADDRESS inputs.

11
15-Sep-20

E1

 Example:(2 – 1) MUX E0

 Block diagram C0

 True table
 Boole function S  C0 E0  C0 E1

 Example: (4–1)MUX X1 X0 Y
 Block diagram 0 0 A0
0 1 A1
 True table
1 0 A2
 Boole function 1 1 A3
 Logic circuit

12
15-Sep-20

 Introduction to ICs
 74157 : consist of 4 (2–1) MUX, Select AB common
control. Strobe G is CS signal
 74153 : consistof 2 (4 – 1) MUX.
 74151 : consistof 1 (8 – 1) MUX.

13
15-Sep-20

 Use MUX implement Boole


 Use (2n – 1) MUX implement n variables Boole funct
 Example: use (8–1) MUX implement f function

 Multiplexer used to implement a logic function


described by the truth table.

14
15-Sep-20

 Use (2n –1) MUX implement (n+1) variable Boole


function
 Example: use (4–1) MUX implement f function

 Connect MUXs
 Example: connect 2 (4–1) MUX to get (8–1) MUX

15
15-Sep-20

 DEMUX=DeMultiPlexer
 There is 1 input
 There are n control inputs
 There are 2n outputs
 Only one output is connected to the input at a time, the
combination of control inputs determines which output
is connected to the inputs.

 Example: (1–2) DeMUX S0

E
 Block diagram:
S1

C0

 True table

16
15-Sep-20

 Example: (1–4) DEMUX


 Block diagram X1 X0 Y0 Y1 Y2 Y3
 True table 0 0 A 0 0 0
 Boole function 0 1 0 A 0 0
1 0 0 0 A 0
 Logic circuit 1 1 0 0 0 A

 Introduction to ICs
 74LS155 : consist of 2 (1 – 4) DEMUX

17
15-Sep-20

 Use DEMUX implement Boole function


 Example: implement f use (1–4) DEMUX

Comparator
 Used to compare 2 binary numbers
 If we need to compare 2 binary numbers A and B
 A = an-1 … a2 a1 a0 and B = bn-1 …b2 b1 b0

 Principle: compare bit to bit : a n-1 và bn-1 …

 Comparison circuit
A B (A>B) (A<B) (A=B)
 Block diagram
0 0 0 0 1
 True table 0 1 0 1 0
 Boole function 1 0 1 0 0
1 1 0 0 1

18
15-Sep-20

 Logic circuit

 Compare 2 (1-bit) numbers with control input


 Block diagram
 True table
 Boole function

(A>B) (A<B) (A=B) A B (A>B) (A<B) (A=B)


I I I o o o
1 0 0 X x 1 0 0
0 1 0 x x 0 1 0
0 0 1 0 0 0 0 1
0 0 1 0 1 0 1 0
0 0 1 1 0 1 0 0
0 0 1 1 1 0 0 1

19
15-Sep-20

 Boole function

 Circuit comparator 2 numbers n bit: is made up of


n circuits comparing 2 numbers 1 bit
 Example: A 3-bit 2-digit comparison circuit

20
15-Sep-20

 Introduction to ICs
 74LS85 : comparator 2 (4 bit) numbers

 Adder
 HA – Half adder
 Block diagram
 True table
 Boole function
 Logic circuit

21
15-Sep-20

 Adder (Cont)
 FA (Full – adder)
 Block diagram
 True table

 Boole function
 Logic circuit

22
15-Sep-20

 Parallel adder : add 2 number n is made from n


FA with 2 (1 bit) number
 Example: add 2 (4 bit) number

Example

 Block diagram of a five-bit parallel adder circuit


using full adders.

23

You might also like