Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Multiplexing and Multiplexer Multiplexer Implementation

Multiplexers are circuits which select one of many inputs


In here, we assume that we have one-bit inputs We can write a logic expression for output F as follows
(in general, each input may have more than one bit) F = X Y Z I0 + X Y Z I1 + X Y Z I2 + X Y Z I3
+ X Y Z I4 + X Y Z I5 + X Y Z I6 + X Y Z I7
Suppose we have eight inputs: I0, I1, I2, I3, I4, I5, I6, I7
This circuit can be implemented using
We want one of them to be output based on selection signals
eight 4-input AND gates and one 8-input OR gates
3 bits of selection signals to decide which input goes to output
Note the order of selection signals XY Z F
XY Z F
X is MSB and Z is LSB 0 0 0 I0
0 0 0 I0 I0 I1 I2 I3 I4 I5 I6 I7
0 0 1 I1 0 0 1 I1
8-to-1 Multiplexer
0 1 0 I2 X S2 0 1 2 3 4 5 6 7 0 1 0 I2
I0 I1 I2 I3 I4 I5 I6 I7 Y S1 0 1 1 I3
0 1 1 I3
1 0 0 I4 Z S0 F 1 0 0 I4
X S2 0 1 2 3 4 5 6 7 1 0 1 I5
Y S1 1 0 1 I5
1 1 0 I6 1 1 0 I6
Z S0 F 1 1 1 I7
1 1 1 I7
CprE 210 Lec 15 1 CprE 210 Lec 15 2

Implementing 4-to-1 MUX using 2-to-1 MUXs Making a 2-bit 4-to-1 Multiplexer

I0 I1 I2 I3 Four 2-bit inputs A, B, C, D


One 2-bit output F ABC D
Two bits of selection signal X Y
0 1 0 1
S0 S0 2x1 MUX S0 S0 2x1 MUX
X Y F
0 0 A
0 1 B
1 0 C X 0 1 2 3 0 1 2 3
1 1 D Y
0 1 X
4-1
S1 MUX X S1 MUX
4-1
S1 S0 2x1 MUX
Y S0 Y S0
F F

F
CprE 210 Lec 15 3 CprE 210 Lec 15 4

Synthesis of Logic Functions using Multiplexers Implementing 3-variable functions with 4x1 MUX

Multiplexers can be directly used to implement a function Divide the outputs into 4 groups based on X and Y.
Easiest way is to use function inputs as selection signals Write the outputs as a function of Z
Input to multiplexer is a set of 1s and 0s depending on the There are only 4 possibilities: F=Z, F=Z, F=0, F=1
function to be implemented
We use a 8-to-1 multiplexer to implement function F
XY Z F
Three select signals are X, Y, and Z, and output is F 0 0 0 0 Z Z 0 1
Eight inputs to multiplexer are 1 0 1 0 1 1 0 0 XY Z F F=Z
0 0 1 1
Depending on the input signals 0 0 0 1 0 1 0 1 0 1 2 3
0 0 1 0 F=Z' X S1
multiplexer will select proper output 0 1 1 0 4x1 MUX
0 1 0 1 1 0 0 0 Y S0
1 0 1 0 1 1 0 0 0 1 1 0 F=0
1 0 1 0
1 0 0 1 1 1 0 1 F
X S2 0 1 2 3 4 5 6 7 1 0 1 1 1 1 1 1 F=1
Y S1 1 1 0 0
Z S0 1 1 1 0
F

CprE 210 Lec 15 5 CprE 210 Lec 15 6


Implementing 4-variable functions with 8x1 MUX Implementing 4-variable functions with 4x1 MUX

A B C D F A B C D F
0 0 0 0 0 0 0 0 0 0
F=D
0 0 0 1 1 0 0 0 1 1 CDCD
F=D
0 0 1 0 0 0 0 1 0 0
F=D
0 0 1 1 1 0 0 1 1 1
D D D 0 0 D 1 1
0 1 0 0 1 0 1 0 0 1
0 1 0 1 0
F=D 0 1 0 1 0
0 1 1 0 0 A S2 0 1 2 3 4 5 6 7 0 1 1 0 0 F=CD
D 1
0 1 1 1 0 F=0 B S1
8x1 MUX 0 1 1 1 0
1 0 0 0 0 C S0 1 0 0 0 0
F=0
1 0 0 1 0
0 1 2 3
1 0 0 1 0 F=CD A S1
1 0 1 0 0 F 1 0 1 0 0 4x1 MUX
F=D B S0
1 0 1 1 1 1 0 1 1 1
1 1 0 0 1 1 1 0 0 1
F=1 1 1 0 1 1
F
1 1 0 1 1
1 1 1 0 1 F=1
1 1 1 0 1
1 1 1 1 1 F=1 1 1 1 1 1
CprE 210 Lec 15 7 CprE 210 Lec 15 8

Implementing 4-variable functions with 4x1 MUX Definition of Decoder


Suppose we have n input bits (which can represent up to 2n
A B C D F
distinct elements of coded information).
0 0 0 0 0
0 0 0 1 0 We need a device that allows us to select which of the 2n
F= elements, devices, memory locations, etc. is being selected.
0 0 1 0 0
0 0 1 1 0 In general:
0 1 0 0 0 A decoder has n input bits
0 1 0 1 0
F= A decoder has 2n (or less) output bits
0 1 1 0 0
0 1 1 1 1 As a rule, all but one of the outputs is zero (deselected) at
1 0 0 0 0 any time (called one-hot encoded)
0 1 2 3
1 0 0 1 0 F= A S1
1 0 1 0 1 4x1 MUX
B S0
1 0 1 1 1
1 1 0 0 0 F
1 1 0 1 1 F=
1 1 1 0 1
1 1 1 1 1
CprE 210 Lec 15 9 CprE 210 Lec 15 10

2-to-4 Decoder Definition of Encoder


The 2-to-4 decoder is a block which decodes the 2-bit binary Encoders perform the inverse function of Decoders.
inputs and produces four outputs An encoder has 2n (or less) input bits and n output bits
One output corresponding to the input combination is a one The output bits generate the binary code corresponding to the
Two inputs and four outputs are shown in the figure input value
The equations are Assuming only one input has a value of 1 at any given time
y0
y0 = x1. x0 x1 Example: An 8-to-3 Encoder
2-to-4 y1 Inputs Outputs
y1 = x1. x0
y2 = x1 . x0 x0 decoder y2 D7 D6 D5 D4 D3 D2 D1 D0 A2 A1 A0
y3 = x1 . x0
y3 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1 A2=D4+D5+D6+D7
The truth table: x1 x0 y3 y2 y1 y0 0 0 0 0 0 1 0 0 0 1 0
A1=D2+D3+D6+D7
0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0 A0=D1+D3+D5+D7
0 1 0 0 1 0
0 0 1 0 0 0 0 0 1 0 1
1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0
1 1 1 0 0 0 1 0 0 0 0 0 0 0 1 1 1
CprE 210 Lec 15 11 CprE 210 Lec 15 12
What are the outputs of the following circuits? Priority Encoders
Each input signal has a priority level associated with it
May have more than one 1s in the input signals
y0 Outputs indicate the active input that has the highest priority
x1 a1 Example: 4-to-2 priority encoder
2-to-4 y1 4-to-2
Assume w3 has the highest priority and w0 the lowest
x0 decoder y2 encoder a0 y1 y0 indicate the active input with highest priority
y3 z indicates none of the inputs is equal to 1
w3 w2 w1 w0 y1 y0 z Let i0 = w0 w1 w2 w3
y0 b0
0 0 0 0 d d 0 i1 = w1 w2 w3
x1 0 0 0 1 0 0 1 i2 = w2 w3
y1 4-to-2 2-to-4 b1
0 0 1 x 0 1 1 i3 = w3
y2 encoder x0 decoder b2
0 1 x x 1 0 1 Then y0 = i1 + i3
y3 b3
1 x x x 1 1 1 y1 = i2 + i3
x: both 0 and 1 (irrelevant)
CprE 210 Lec 15 13 CprE 210 Lec 15 14

Decoder with Enable Truth Table for 2-to-4 Decoder with Enable

x1 x0 E y3 y2 y1 y0
A 2-to-4 decoder can be designed with an enable signal
If enable is zero, all outputs are zero 0 0 0 0 0 0 0
If enable is 1, then an output corresponding to two inputs is a 0 0 1 0 0 0 1
one, all others are still zero
0 1 0 0 0 0 0
The equations are
y0 = x1. x0. E E 0 1 1 0 0 1 0
y1 = x1. x0 . E 1 0 0 0 0 0 0
y2 = x1 . x0. E y0
x1 1 0 1 0 1 0 0
y3 = x1 . x0 . E y1
2-4 decoder y2 1 1 0 0 0 0 0
x0
y3 1 1 1 1 0 0 0

CprE 210 Lec 15 15 CprE 210 Lec 15 16

Demultiplexers 3-to-8 decoder using a 2-to-4 decoder with Enable


Perform the opposite function of multiplexers
Placing the value of a single data input onto one of the multiple The 3-to-8 decoder can be implemented using two 2-to-4
data outputs decoders with enable and one NOT gate
Same implementation as decoder with enable The implementation is as shown
Enable input of decoder serves as the data input for the x2 E
demultiplexer y0
x1 y1
D
2-4 decoder y2
y0 x0
x1 y3
y1 E
2-4 DEMUX y2 y4
x0
y3 y5
2-4 decoder y6
y7

CprE 210 Lec 15 17 CprE 210 Lec 15 18

You might also like