11-Multiplexers and Demultiplexers
11-Multiplexers and Demultiplexers
& Demultiplexers
Digital Design. M. Morris Mano
Prof. Imane Aly Saroit Ismail 1 Logic Design
Multiplexers
The multiplexer (also known as Data Selector) is a
combinational circuit that a device that allows one of
several analog or digital input signals to be selected and
directs this input into a single output.
It has 2n data inputs, n selection lines and single output
line. One of these data inputs will be connected to the
output based on the values of selection lines.
1
Multiplexers
The output depends on the minterms of the Select Lines.
Block Diagram
S Y
2x1 Multiplexer 0 I0 Function
Table
1 I1
2
4x1 Multiplexer
S1 S0 Y
Four inputs: I0, I1, I2, I3 0 0 I0
Two Selectors: S0, S1 0 1 I1
One Output: Y 1 0 I2
1 1 I3
Function Table
𝐘 = 𝐒𝟏 𝐒𝟎 𝐈𝟎 + 𝐒𝟏 𝐒𝟎 𝐈𝟏 + 𝐒𝟏 𝐒𝟎 𝐈𝟐 + 𝐒𝟏 𝐒𝟎 𝐈𝟑
4x1 Multiplexer
Block Diagram
Logic Diagram
3
Multiplexer with enable
A multiplexer can have an additional input signal called
the enable which enables or disables the generated
output. So a multiplexer with enable has 2n data inputs,
an enable, n selection lines and a single output line.
In general (active high enable):
If enable=0, all the outputs=0.
If enable=1, the output chooses one of the inputs
according to the select lines.
Prof. Imane Aly Saroit Ismail 7 Logic Design
Block Diagram
4
4x1 Multiplexer with enable
E S1 S0 Y
Four inputs: I0, I1, I2, I3 0 x x 0
Two Selectors: S0, S1 1 0 0 I0
Enable Input: E 1 0 1 I1
One Output: Y 1 1 0 I2
1 1 1 I3
Function Table
𝐘 = 𝐄 𝐒𝟏 𝐒𝟎 𝐈𝟎 + 𝐄 𝐒𝟏 𝐒𝟎 𝐈𝟏 + 𝐄 𝐒𝟏 𝐒𝟎 𝐈𝟐 + 𝐄 𝐒𝟏 𝐒𝟎 𝐈𝟑
4x1 Multiplexer
with enable
Block Diagram
Logic Diagram
5
Multiplexers with three state gates
Another type of multiplexer with enable, is by using
three state buffer.
In general (active high enable):
If enable=0, all the outputs=High impedance.
If enable=1, the output chooses one of the inputs
according to the select lines.
Multiplexers
with three
state gates
6
Building a 8x1 Multiplexer using two 4x1
Multiplexers with enable
E First Second S2 S1 S0 Y
MUX MUX
0 0 0 0 I0
The first Mux The first Mux
The Second
is working
Mux is not
0 working 0 0 1 I1
0 0 1 0 I2
0 0 1 1 I3
1 1 0 0 I4
The Second
is working
working
1 1 0 1 I5
is not
Mux
1 1 1 0 I6
1 1 1 1 I7
7
Building a 8x1 Multiplexer using two 4x1
Multiplexers and one 2x1 Mux
Quadruple Multiplexers
• Many multiplexer circuits can be combined with common
selection inputs to provide multiple-bit(s) selection logic.
• A quadruple (Quad) multiplexer is actually four
multiplexers, with common selectors.
8
Quad 2x1 Multiplexers
If (Select=0)
Y=A (Yi=Ai)
(Y3=A3, Y2=A2,
Y1=A1, Y0=A0)
If (Select=1)
Y=B (Yi=Bi)
(Y3=B3, Y2=B2,
Y1=B1, Y0=B0)
9
Using a Multiplexer to build a function
Example 1:
Build F(A,B,C,D)=m(1,2,8,10,11,12,13,14,15) using a
16x1 multiplexer.
10
Using a Multiplexer to build a function
Usually, the optimal method to build a function of n inputs,
is by using a multiplexer with n-1 selection lines, and 2n-
1 data inputs.
11
Using a Multiplexer
Used in
Inputs
Selectors
to build a function A B C
0 0 0
D
0
F
0
F=D
0 0 0 1 1
0 0 1 0 1
F=1
0 0 1 1 1
0 1 0 0 0
F=0
0 1 0 1 0
0 1 1 0 0
F=0
0 1 1 1 0
1 0 0 0 1
F=𝐃
1 0 0 1 0
1 0 1 0 1
F=𝐃
1 0 1 1 0
1 1 0 0 1
F=1
1 1 0 1 1
1 1 1 0 1
F=1
1 1 1 1 1
12
Using a Multiplexer to build a function
Example 3:
Build F(A,B,C,D)=m(1,2,3,8,10,12,13,14,15) using a 4x1
multiplexer.
Used in
Using a Multiplexer Selectors Inputs
A B C D F
to build a function 0 0 0 0 0 D
0 0 0 1 1 C 0 1
F=C+D
0 0 1 0 1 0 1
0 0 1 1 1 1 1 1
0 1 0 0 0
0 1 0 1 0
F=0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 1
1 0 0 1 0
F=𝐃
1 0 1 0 1
1 0 1 1 0
1 1 0 0 1
1 1 0 1 1
F=1
1 1 1 0 1
1 1 1 1 1
13
Example 4:
Having two input A and B, build the following function using
a multiplexer with the optimal size and any other gates you
may need: If (A≠B) then F=0 else F=1.
A B F
First method:
0 0 1
F=B
0 1 0
1 0 0
F=B
1 1 1
Prof. Imane Aly Saroit Ismail 27 Logic Design
Example 4:
Second method:
If (A≠B) then F=0 else F=1.
Is equivalent to
If (AB=1) then F=0 else F=1
14
Example 5:
Having a number of four bits ABCD,
build the following function using a
multiplexer with the optimal size and
any other gates you may need:
If (ABCD is and odd number) then
F=0 else F=1.
This function is equivalent to:
If (D=1) then F=0 else F=1.
Example 6:
A combinational circuit consists of two inputs A,B, two
select lines S1S0 (=S) and an output F defined as follows:
• If (S=0) then 𝐅 = 𝐀
• If (S=1) then F=A+B (Addition)
• If (S=2) then F=A-B
• If (S=3) then 𝐅 = 𝐁
Build F using: a full adder, a 4x1 multiplexer, an XOR and
an inverter.
15
Example 6:
• If (S1S0 =00) then 𝐅 = 𝐀
• If (S1S0 =01) then F=A+B (Use full adder with Cin =0)
• If (S1S0 =10) then F=A-B
A + 𝐁 +1 A + (B 1)+1
Use full adder with Cin =1 and an XOR)
• If (S1S0 =11) then 𝐅 = 𝐁 B 1 (Need XOR)
S1 is used as Cin
Prof. Imane Aly Saroit Ismail 31 Logic Design
Example 6:
16
Demultiplexers
The demultiplexer is a combinational circuit that
performs the inverse operation of a multiplexer. It has
one input, n selection lines and 2n data outputs.
Based on the values of selection lines, the input is
directed (transmitted) into a single output.
Demultiplexers
Block Diagram
17
1x4 Demultiplexer
One Input: E S1 S0 D0 D1 D2 D3
0 0 E 0 0 0
Four outputs: D0, D1, D2, D3
0 1 0 E 0 0
Two Selectors: S0, S1 1 0 0 0 E 0
1 1 0 0 0 E
𝐃 = 𝐄 𝐒𝟏 𝐒 𝟎 𝐃 = 𝐄 𝐒𝟏 𝐒 𝟎 Function Table
𝐃 = 𝐄 𝐒𝟏 𝐒 𝟎 𝐃 = 𝐄 𝐒 𝟏 𝐒𝟎
1x 4 Demultiplexer
Block Diagram
Logic Diagram
18
1x 4 Demultiplexer
It is clear that the logic diagram of the 1x4 Demultiplexer
resembles that of a 2x4 decoder with enable.
2x4 decoder with enable: 2x4 decoder 1x4
Two inputs, Four outputs, with enable demultiplexer
Demultiplexers
In general a 1x2n demultiplexer is equivalent to nx2n decoder
with enable.
19