Lecture 9 - MSI Circuits
Lecture 9 - MSI Circuits
decoder encoder
code entity entity code
select select
Decoders
Convert binary information from n input lines to
n
(max. of) 2 output lines.
Known as n-to-m-line decoder, or simply n:m or
nm decoder (m 2n).
May be used to generate 2n (or fewer) minterms of
n input variables.
Decoders
Example: if codes 00, 01, 10, 11 are used to identify four
light bulbs, we may use a 2-bit decoder:
2x4
F0 Bulb 0
2-bit X Dec Bulb 1
F 1
code Y F2 Bulb 2
F3 Bulb 3
F2 = XY'
F3 = XY
X Y
Decoders
Design a 38 decoder by yourself.
Solution
Decoders
In general, for an n-bit code, a decoder could select up to
2n lines:
n n
n-bit n to 2 up to 2
code : decoder : output lines
Outputs
Y0 = D.S1'.S0' S1 So Y0 Y1 Y2 Y3
0 0 D 0 0 0
Y1 = D.S1'.S0
Data D demux
0 1 0 D 0 0
Y2 = D.S1.S0' 1 0 0 0 D 0
1 1 0 0 0 D
Y3 = D.S1.S0
S1 S 0
select
Demultiplexer
• The demultiplexer is actually identical to a decoder
with enable. A decoder with an enable input can
function as a demultiplexer (or demux)
Decoder + enable= demultiplexer
• The selection of a specific output line is controlled
by the bit values of ‘n’-selection lines.
Y0 = D.S1'.S0'
2x4
S1 Decoder Y1 = D.S1'.S0
data demux output
S0 Y2 = D.S1.S0'
E Y3 = D.S1.S0
select
D
4-line-to-16 line Decoder constructed with two 3-line-to-8 line decoders with
enables
15
4-line-to-16 line Decoder constructed with two 3-line-to-8 line decoders with
enables
16
F(a,b,c,d)=∑(0,1,3,5,12,13)
Implement the above boolean function using
a. 3:8 Decoder(s).
b. 2:4 Decoder(s).
17
F(a,b,c,d)=∑(0,1,3,5,12,13)
Implement the above boolean function using
a. 3:8 Decoder(s).
b. 2:4 Decoder(s).
18
Multiplexer
A multiplexer is a device which has
(i) a number of input lines
(ii) a number of selection lines
(iii) one output line
A Multiplexer steers one of 2n inputs to a single output line,
using n selection lines. Also known as a data selector.
2n:1
inputs Multiplexer output
:
...
select
Multiplexer
Truth table for a 4-to-1 multiplexer:
I0 I1 I2 I3 S1 S0 Y S1 S0 Y
d0 d1 d2 d3 0 0 d0 0 0 I0
d0 d1 d2 d3 0 1 d1 0 1 I1
d0 d1 d2 d3 1 0 d2 1 0 I2
d0 d1 d2 d3 1 1 d3 1 1 I3
Inputs Inputs
I0 0 I0
I1 4:1
1 I1
MUX
I2 2 Y Output I2 mux Y
I3 3 I3
S1 S0
S1 S0
select select
Multiplexer
Output of multiplexer is
“sum of the (product of data lines and
selection lines)”
Often known as Data selector as it selects one
of the many inputs and steers the binary
information to the output line.
Example: the output of a 4-to-1 multiplexer is:
Y = I0.(S1’.S0') + I1.(S1’.S0) + I2.(S1.S0') + I3.(S1.S0)
Try it yourself
• Draw the internal circuit diagram (logic diagram) of a 4-to-1
multiplexer.
Solution
Y = I0.(S1’.S0') + I1.(S1’.S0) + I2.(S1.S0') + I3.(S1.S0)
Larger Multiplexers
Larger multiplexers can be constructed from smaller ones.
An 8-to-1 multiplexer can be constructed from smaller
multiplexers like this (from two 4x1 and one 2x1):
S2 S1 S0 Y
0 0 0 I0
0 0 1 I1
0 1 0 I2
0 1 1 I3
1 0 0 I4
1 0 1 I5
1 1 0 I6
1 1 1 I7
Larger Multiplexers
Larger multiplexers can be constructed from smaller ones.
An 8-to-1 multiplexer can be constructed from smaller
multiplexers like this (from two 4x1 and one 2x1):
I0 When S2 S1 S0 Y
I1 4:1 S2S1S0 = 000
I0 0 0 0 I0
I2 MUX
0 0 1 I1
I3
2:1 I0 0 1 0 I2
S1 S0 MUX Y 0 1 1 I3
I4 1 0 0 I4
I5 4:1 1 0 1 I5
I6 MUX I4 1 1 0 I6
S2
I7 1 1 1 I7
S1 S0
Larger Multiplexers
Another implementation of an 8-to-1 multiplexer using
smaller multiplexers (four 2x1 and one 4x1):
S2 S1 S0 Y
0 0 0 I0
0 0 1 I1
0 1 0 I2
0 1 1 I3
1 0 0 I4
1 0 1 I5
1 1 0 I6
1 1 1 I7
Larger Multiplexers
Another implementation of an 8-to-1 multiplexer using
smaller multiplexers (four 2x1 and one 4x1):
When
I0 2:1 I0 S2S1S0 = 000 S2 S1 S0 Y
I1 MUX 0 0 0 I0
0 0 1 I1
I2 2:1 I2 S0 0 1 0 I2
MUX 0 1 1 I3
I3
1 0 0 I4
4:1 I0
S0 Y 1 0 1 I5
MUX 1 1 0 I6
I4 2:1 I4 1 1 1 I7
I5 MUX
S2 S1
S0 I 2:1
6
I7 MUX I6
S0
Q: Can we use only 2:1 multiplexers?
Larger Multiplexers
Q: Can we use only 2:1 multiplexers?
Try it yourself: Larger Multiplexers
A 16-to-1 multiplexer can be constructed from only 4-to-1 multiplexers:
Multiplexer with enable input
We can
construct it
using four 2x1
line multiplexer
for inserting the
input and then
three 2x1 line
multiplexer for
combining the
result
Encoder
• Encoder is a digital function that produces a reverse operation of a
decoder!
• It has 2n input lines and n output lines
Example: Octal-binary encoder
Example: Octal-binary encoder
AND OR
GND GND
+5v
+5v
NOT
+5v
X
X
GND
Try it yourself
a)Built the following function using 8x1 Mux.
F=∑(0,4,5)
b)Design same thing with 3x8 decoder
c) Try designing it with single 4x1 Mux
Solution
• F=∑(0,4,5)
a) b)
5V
Rules: for using smaller mux to build
larger equation
Answer: Part ( c )
1
A
0
0
1 A 0 0 B C
Built the following function using 4x1 Mux
Try it yourself
a) Implement the below function using a 8x1 Mux.
b) Implement the below function using a 4x16 decoder and OR gates
Solution
Home-task: Try it yourself
Using 2:1 MUX design
• AND gate
• OR gate
• NOT gate
Note:
• Both mux and decoder can be used to design combinational circuit.
• Decoder are mostly used to decoding binary information and mux are
mostly used to select path between multiple sources and a single
destination.
16 variables with 4x1 Mux
https://www.youtube.com/watch?v=c8lhlAX2JMk
F(a,b,c,d)=∑(0,1,4,5,9,14,15)
Implement the above boolean function using 4:1 MUX(s) and 2:1 MUX(s).
Combining MSI to build
Combinational Design Circuit
Exercise time!
• Design a BCD to Excess 3 code converter using ‘4x16’ decoder and
‘16x4’ encoder
Solution
16:4
encoder
Try it yourself
• Design a full adder using ‘3x8’ decoder and ‘4x2’ encoder
Solution:
Try it yourself
• Design ‘4x1’ mux using ‘2x4’ decoder
• Design ‘4x1’ demux using ‘2x4’ decoder