Encoders and Multiplexer
Circuits
By
Dr. Nermeen Talaat
Lecture 12
1
Encoder
Encoding – An encoder is a digital function that performs the
inverse operation of a decoder. An encoder has 2n inputs
and n output lines that indicate which single bit of the input is
active.
encoder
entity code
2
Example- 4-to-2 encoder
Assume only one input ‘on’ at a time.
8-to-3 encoder
The application of this encoder is the octal-to-binary
conversion.
Major Limitation of Encoders
Exactly one input must be active at any given time.
If the number of active inputs is less than one or more
than one, the output will be incorrect.
For example, if E3 = E6 = 1, the output of the encoder
A2A1A0 = 111, which implies incorrect output.
The priority encoders solves the problems mentioned
above by allocating a priority level to each input.
The priority encoders
The priority encoders output corresponds to the currently
active input which has the highest priority.
So when an input with a higher priority is present, all other
inputs with a lower priority will be ignored.
Example for the 4-to-2 priority encoder:
The most significant bit of the input has the highest priority
while the least significant bit has the lowest priority.
Encoder
Example: Octal-to-binary encoder.
D0
D1 x = D4 + D5 + D6 + D7
D2
D3 y = D2 + D3 + D6 + D7
D4
D5
D6
D7 z = D1 + D3 + D5 + D7
8-to-3 encoder
Exercise: Can you design a 2n-to-n encoder without the K-map?
7
Encoder
8
Multiplexers
A multiplexer (MUX) is a device that allows digital information from
several sources to be routed onto a single line for transmission over that
line to a common destination.
The basic multiplexer has several data-input lines and a single output
line.
It also has data-select inputs. which permit digital data on anyone of
the inputs to be switched to the output line.
Multiplexers are also known as data selectors.
mux data
input
select
Multiplexing in general
You have 2n input lines and a n-bit selection
control input which routes that specific input
to the output.
Have seen a 2-to-1 mux. – The circuit
10
Multiplexer
A multiplexer is a device which has
(i) a number of input lines
(ii) a number of selection lines
(iii) one output line
It 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
:
... 11
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
I0 I1
0
4:1 I2 mux Y
I1 1
MUX I3
I2 2 Y Output
I3 3
S1 S0 S1 S0
select
select 12
Multiplexer
Output of multiplexer is
“sum of the (product of data lines and selection lines)”
Example: the output of a 4-to-1 multiplexer is:
Y = I0.(S1’.S0') + I1.(S1’.S0) + I2.(S1.S0') + I3.(S1.S0)
A 2n-to-1-line multiplexer, or simply 2n:1 MUX, is made
from an n: 2n decoder by adding to it 2n input lines, one to
each AND gate.
13
The 4-to-1 Multiplexers
In the 2-to-1 mux there is a 1-to-2 decoder and
then the 2 enabling and gates
In a 4-to-1 mux you have a 2-to-4 decoder to
select which of the 4 inputs, D0, D1, D2, D3 is
routed to the output Y.
4-to-1 mux
2 select inputs
4 data line inputs
1 output
14
7. Multiplexers:
The Implementation for a 4-input multiplexer (MUX)
Fig. Logic diagram for a 4-input multiplexer.
Typical occurances
Available
1-to-2, 2-to-4, 3-to-8, and 4-to-16 line decoders
2-to-1, 4-to-1, 8-to-1 multiplexers
Larger sizes, when needed could be
implemented from the basic units.
16
Multiplexers
A logic symbol for a 4-input multiplexer (MUX)
As shown in Figure
Notice that there are two data-select lines because with two select bits.
Anyone of the four data-input lines can be selected.
Fig. 13,
Logic symbol for a 1-of-4 data
selector/multiplexer.
Multiplexers: Implementing Functions
A Boolean function can be implemented using
multiplexers.
A 2n-to-1 multiplexer can implement a Boolean function
of n input variables, as follows:
(i) Express in sum-of-minterms form.
Example: F(A,B,C) = A'B'C + A'BC + AB'C + ABC'
= S m(1,3,5,6)
(ii) Connect n variables to the n selection lines.
(iii) Put a '1' on a data line if it is a minterm of the function,
'0' otherwise.
18
Multiplexers: Implementing Functions
F(A,B,C) = S m(1,3,5,6)
0 0
This method works because:
1 1 Output = m0.I0 + m1.I1 + m2.I2 + m3.I3
0 2
1 3 mux F + m4.I4 + m5.I5 + m6.I6 + m7.I7
0 4
1
1
5
6 Supplying ‘1’ to I1,I3,I5,I6 , and ‘0’ to the
0 7
rest:
A B C Output = m1 + m3 + m5 + m6
Demultiplexer
Given an input line and a set of selection lines, the
demultiplexer will direct data from input to a selected
output line.
An example of a 1-to-4 demultiplexer:
Outputs
Y0 = D.S1'.S0' S1 So Y0 Y1 Y2 Y3
Y1 = D.S1'.S0
0 0 D 0 0 0
Data D demux
0 1 0 D 0 0
Y2 = D.S1.S0' 1 0 0 0 D 0
Y3 = D.S1.S0
1 1 0 0 0 D
S 1 S0
select 20
Demultiplexer
The demultiplexer is actually identical to a decoder with
enable, as illustrated below:
Y0 = D.S1'.S0'
2x4
S1 Decoder Y1 = D.S1'.S0
S0 Y2 = D.S1.S0'
E Y3 = D.S1.S0
Exercise: Provide the truth table for above demultiplexer.
21
Multiplexer
An application:
Helps share a single communication line among a
number of devices.
At any time, only one source and one destination can
use the communication line.
22