Combinational Circuits LDIC
Combinational Circuits LDIC
Circuits
Design
Combinational Circuit
The output of combinational circuit at any
instant of time, depends only on the levels
present at input terminals.
The combinational circuit do not use any
memory. The previous state of input does not
have any effect on the present state of the
circuit.
A combinational circuit can have a n
number of inputs and m number of outputs.
Half Adder
Functions of
Combinational Logic
Agenda
Adders
Comparators
Decoders
Encoders
Multiplexers
Demultiplexers
Adders
Basic Adders
Adders are important in
computers
other types of digital systems in which numerical
data are processed
The Half-Adder
Basic rule for binary addition.
A = A3A2A1A0 ; B = B3B2B1B0
xi=AiBi+AiBi for i = 0, 1, 2, 3
(A = B) = x3x2x1x0
36
Magnitude comparator
We inspect the relative
magnitudes of pairs of MSB. If
equal, we compare the next
lower significant pair of digits
until a pair of unequal digits is
reached.
0
Inequality
Many IC comparators provide additional
outputs that indicate which of the two binary
numbers being compared is the larger.
Inequality
To determine an inequality of
binary numbers A and B, you
first examine the highest-order
bit in each number:
If A3=1 and B3=0 number A is
greater than number B
If A3=0 and B3=1 number A is
less than number B
If A3=B3 you must examine the
next lower bit position for an
equality
IC 74HC85
1100 1011
1100 1010
8-bit magnitude comparator
Decoders
Decoders
A decoder detects the presence of a
specified combination of bits (code) on its
inputs and indicates the presence of that
code by a specified output level.
In its general form, a decoder has n input lines to
handle n bits and forms one to 2n output lines to
indicate the presence of one or more n-bit
combinations.
The Basic Binary Decoder
Suppose we need to determine when a
binary 1001 occurs on the inputs of a digital
ckt.
A variation of the standard decoder
G A B Y0 Y1 Y2 Y3
1 x x 1 1 1 1
0 0 0 0 1 1 1
0 0 1 1 0 1 1
0 1 0 1 1 0 1
0 1 1 1 1 1 0
50
3-to-8 decoder
Larger decoders are similar. Here
is a 3-to-8 decoder
A truth table (without EN) is below
Output equations are at the bottom
right
52
Cascading - 3-to-8 Active-High Decoder
S2 S1 S0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
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
53 0 0 0 0 1
Cascading - 4-to-16 Active-Low Decoder
54
So what good is a decoder?
Do the truth table and equations look familiar?
S
1 S
0 Q
0 Q
1 Q
2 Q
3
Q0 = S1 S0
0 0 1 0 0 0 Q1 = S1 S0
0 1 0 1 0 0 Q2 = S1 S0
1 0 0 0 1 0 Q3 = S1 S0
1 1 0 0 0 1
We will need two bits to represent the total; lets call them C and S, for
carry and sum. Note that C and S are two separate functions of the
same inputs X, Y and Z
56
Decoder-based Adder
3-to-8 decoders implement C(X,Y,Z) = m(3,5,6,7) and S(X,Y,Z) =
m(1,2,4,7)
57
Active-Low Decoders
The output equations for an active-low decoder are mysteriously similar,
yet somehow different
Q3 = (S1 S0) = S1 + S0
Q2 = (S1 S0) = S1 + S0
Q1 = (S1 S0) = S1 + S0
Q0 = (S1 S0) = S1 + S0
58
The 4-Bit Decoder
In order to decode all possible combinations
of four bits, 16 decoding gates are required
(24=16).
This type of decoder is commonly called
either:
A 4-line-to-16-line decoder, or
A 1-of-16 decoder
Decoding functions and truth table for a 4-
line-to-16-line decoder with active-LOW
outputs see the next slide.
The 4-Bit Decoder
The 4-Bit Decoder 74HC154: 1-of-16 decoder
Enable function
There is an enable function,
which is implemented with a
NOR gate used as negative AND.
A low level on each chip select
line CS1 and CS2 is required in
order to make the enable gate
output high.
Problem
INPUT AND OUTPUT SELECTION IN COMPUTERS
The BCD-to-Decimal Decoder
The BCD-to-
decimal
converts each
BCD code into
one of ten
possible
decimal digit
indications.
Called 4-
line-to-10-line
decoder or 1-
of-10 decoder
The BCD-to-Decimal Decoder
The BCD-to-7-Segment
Decoder
The BCD-to-7-
segment decoder
accepts the BCD
code on its inputs and
provides outputs to
drive 7-segment
display devices to
produce a decimal
readout.
BCD to 7-Segment
Decoder/Driver
The BCD-to-7-Segment
Decoder (The Application)
Summary of Decoders
A n-to-2n decoder generates the minterms of an n-variable function
73
Octal-to-Binary Encoder
74
Octal-to-Binary Encoder
A0= D1 + D3 + D5 + D7,
A2= D4 + D5 + D6 + D7
A1= D2 + D3 + D6 + D7
75
Priority Encoder
76
4-Input Priority Encoder
77
4-Input Priority Encoder
78
4-Input Priority Encoder
79
74x148 8-input priority encoder
80
Cascaded Priority Encoders
81
Encoders
An encoder is a combinational logic ckt that
essentially performs a reverse decoder
function.
An encoder accepts an active level on one of
its inputs representing a digit, such as a
decimal or octal digit, and converts it to a
coded output such as BCD or binary.
Encoders can also be devised to encode
various symbols and alphabetic characters.
The Decimal-to-BCD Encoder
It has 10 inputs
and 4 outputs
corresponding
to the BCD
code.
A3 = 8+9
A2 = 4+5+6+7
A1 = 2+3+6+7
A0 = 1+3+5+7+9
The Decimal-to-BCD Encoder
1 1 0 1--G
1 0 0 1-----binary
1 0 0 1---B
1 1 0 1 gray
Keyboard encoder
7-segment Code decoder
Multiplexers
DATA SELECTION
Multiplexers (Data Selectors)
A MUX is a device that allows digital
information from several sources to be routed
onto a single line for data transmission over
that line to a common destination.
The basic MUX 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.
Multiplexers (Data Selectors)
Multiplexers (Data Selectors)
Multiplexers (Data Selectors)
Multiplexers
Multiplexers, or muxes, are used to choose between resources
97
Multiplexers
A n-to-1 multiplexer sends one of n input lines to
a single output line
A multiplexer has two sets of inputs:
n data input lines
s=log2n select lines, to pick one of the n data inputs
98
2-to-1 Mux
The select bit S controls which of the data bits D0-D1
is chosen: S D1 D0 Q
0 0 0 0
0 0 1 1
If S=0, then D0 is the output (Q=D0).
0 1 0 0
If S=1, then D1 is the output (Q=D1). 0 1 1 1
1 0 0 0
Q = S D0 + S D1
1 0 1 0
1 1 0 1
1 1 1 1
100
74x157 Quad 2-to-1 Mux
101
4-to-1 Mux
Decoder
102
4-to-1 Mux
103
Quad 4-to-1 Mux
104
74x151 8-to-1 Multiplexer
105
74x151 8-to-1 Multiplexer
106
Expanding Multiplexers
107
Implementing functions with multiplexers
Muxes can be used to implement arbitrary functions
For each minterm mi of the function, connect 1 to mux data input Di.
Each data input corresponds to one row of the truth table
Connect the functions input variables to the mux select inputs. These
are used to indicate a particular input combination
x y z f
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1 108
A more efficient way
We can actually implement f(x,y,z) = m(1,2,6,7) with
just a 4-to-1 mux, instead of an 8-to-1 x y z f
0 0 0 0
0 0 1 1
Step 1: Find the truth table for the function, and
0 1 0 1
group the rows into pairs. Within each pair of rows, 0 1 1 0
x and y are the same, so f is a function of z only. 1 0 0 0
1 0 1 0
When xy=00, f=z
When xy=01, f=z
1 1 0 1
When xy=10, f=0
1 1 1 1
When xy=11, f=1
The basic setup is to connect two of the input variables (usually the first
two in the truth table) to the mux select inputs
X Y Z C
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
With S1=X and S0=Y, then
1 1 1 1
Q=XYD0 + XYD1 + XYD2 + XYD3
110
Multiplexer-based carry
We can set the multiplexer data inputs D0-D3,
by fixing X and Y and
finding
X Y Z equations
C for C in terms of just Z.
0 0 0 0
When XY=00, C=0
0 0 1 0
0 1 0 0
When XY=01, C=Z
0 1 1 1
1 0 0 0
When XY=10, C=Z
1 0 1 1
1 1 0 1
1 1 1 1 When XY=11, C=1
C = X Y D0 + X Y D1 + X Y D2 + X Y D3
= X Y 0 + X Y Z + X Y Z + X Y 1
= X Y Z + X Y Z + XY
= m(3,5,6,7)
111
Multiplexer-based sum
Heres the same thing, but for the sum function
S(X,Y,Z)
X Y Z S
0 0 0 0
When XY=00, S=Z
0 0 1 1
0 1 0 1
When XY=01, S=Z
0 1 1 0
1 0 0 1 When XY=10, S=Z
1 0 1 0
1 1 0 0 When XY=11, S=Z
1 1 1 1
S = X Y D0 + X Y D1 + X Y D2 + X Y D3
= X Y Z + X Y Z + X Y Z + X Y Z
= m(1,2,4,7)
112
Summary of Muxes
113
74HC157A (2:1 Mux)
Quad 2 Input data selector
74LS151 (8:1 Mux)
Problem
7-segment display multiplexer:Application example
Demultiplexers
Demultiplexers
A DEMUX basically
reverses the MUX
function.
It takes digital
information from one
line and distributes it to
a given number of
output lines.
It also known as data
distributor.
Demultiplexer
74HC138 3-t0-8 line decoder as
de-mux
74HC154 DECODER AS DE-MUX
PARITY GENERATORS
74LS280 9-bit parity
generator/checker
Data transmission system with error detection
8-Bit words with correct and
incorrect parity