Priority Encoder
Priority Encoder
Priority Encoder
Material to be covered
Supplemental
Chapter 9: Sections 1 4
Fall 2010
Multiplexers
Fall 2010
Multiplexers
A multiplexer has
N control inputs
2N data inputs 1 output
A multiplexer routes (or connects) the selected data input to the output.
The value of the control inputs determines the data input that is selected.
ECE 331 - Digital System Design 4
Fall 2010
Multiplexers
Z = A.I0 + A.I1
ECE 331 - Digital System Design 5
Multiplexers
A 0 0 1 1 B 0 1 0 1 F I0 I1 I2 I3
MSB
LSB
Multiplexers
A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 F I0 I1 I2 I3 I4 I5 I6 I7
MSB
LSB
Multiplexers
Fall 2010
Fall 2010
Fall 2010
10
Multiplexers
Exercise:
Fall 2010
11
Multiplexers
Exercise:
Fall 2010
12
Multiplexer (Bus)
Fall 2010
13
Demultiplexers
Fall 2010
14
Demultiplexers
A demultiplexer has
A demultiplexer routes (or connects) the data input to the selected output.
The value of the control inputs determines the output that is selected.
Fall 2010
Demultiplexers
Out0
In
Out1 Out2
Out3
S1 S0
W X Y Z
A B
A
0 0 1
B
0 1 0
W
I 0 0
X
0 I 0
Y
0 0 I
Z
0 0 0
1
Fall 2010
I
16
Decoders
Fall 2010
17
Decoders
A decoder has
N inputs 2N outputs
N
A decoder selects one of 2 outputs by decoding the binary value on the N inputs.
The decoder generates all of the minterms of the N input variables.
Exactly one output will be active for each combination of the inputs.
What does active mean?
ECE 331 - Digital System Design 18
Fall 2010
Decoders
Out0
B A
msb
I0 I1
W X Y Z
Z = A.B
Active-high outputs
A 0 0 1 1
Fall 2010
B 0 1 0 1
W 1 0 0 0
X 0 1 0 0
Y 0 0 1 0
Z 0 0 0 1
19
Decoders
Out0
B A
msb
I0 I1
W X Y Z
Z = (A.B)'
Active-low outputs
A 0 0 1 1
Fall 2010
B 0 1 0 1
W 0 1 1 1
X 1 0 1 1
Y 1 1 0 1
Z 1 1 1 0
20
Decoders
msb
Fall 2010
21
Fall 2010
22
Fall 2010
23
B A Enable
En 1 1 1 1 0 A 0 0 1 1 x
I0
I1 En
W X Y Z
B 0 1 0 1 x
W 1 0 0 0 0
X 0 1 0 0 0
Y 0 0 1 0 0
Z 0 0 0 1 0
24
enabled
disabled
Fall 2010
B A Enable
En 0 0 0 0 1 A 0 0 1 1 x
I0
I1 En
W X Y Z
B 0 1 0 1 x
W 1 0 0 0 0
X 0 1 0 0 0
Y 0 0 1 0 0
Z 0 0 0 1 0
25
enabled
disabled
Fall 2010
Fall 2010
26
Decoders
Exercise:
Fall 2010
27
Encoders
Fall 2010
28
Encoders
An encoder has
2N inputs N outputs
An encoder outputs the binary value of the selected (or active) input. An encoder performs the inverse operation of a decoder. Issues
Fall 2010
Encoders
D C
I0 I1 I2 Out0 Out1
B
A
Z Y
I3
A 0 0 0 1
Fall 2010
B 0 0 1 0
C 0 1 0 0
D 1 0 0 0
Y 0 0 1 1
Z 0 1 0 1
30
Priority Encoders
If more than one input is active, the higher-order input has priority over the lower-order input.
d=1
Why is the valid indicator needed?
ECE 331 - Digital System Design 31
Fall 2010
Priority Encoders
msb
Valid bit
Fall 2010
32
ARCHITECTURE Behavior OF priority IS BEGIN y <= "11" WHEN w(3) = '1' ELSE "10" WHEN w(2) = '1' ELSE "01" WHEN w(1) = '1' ELSE "00" ; z <= '0' WHEN w = "0000" ELSE '1' ; END Behavior ;
33
Fall 2010
34
Use an n-input multiplexer to realize a logic circuit for a function with n minterms.
Each minterm of the function can be mapped to an input of the multiplexer. For each row in the truth table, for the function, where the output is 1, set the corresponding input of the multiplexer to 1.
That is, for each minterm in the minterm expansion of the function, set the corresponding input of the multiplexer to 1.
ECE 331 - Digital System Design 35
Fall 2010
Example: Using an 8-to-1 multiplexer, design a logic circuit to realize the following Boolean function F(A,B,C) = Sm(2, 3, 5, 6, 7)
Fall 2010
36
Example: Using an 8-to-1 multiplexer, design a logic circuit to realize the following Boolean function F(A,B,C) = Sm(1, 2, 4)
Fall 2010
37
Use an (n / 2)-input multiplexer to realize a logic circuit for a function with n minterms.
Group the rows of the truth table, for the function, into (n / 2) pairs of rows.
Determine the logical function of each pair of rows in terms of the mth variable.
Fall 2010
If the mth variable, for example, is x, then the possible values are x, x', 0, and 1.
38
Fall 2010
39
Fall 2010
40
The design of a logic circuit using an (n / 2)-input multiplexer can be easily extended to the use of an (n / 4)-input multiplexer.
Fall 2010
41
Fall 2010
42
Use an n-output decoder to realize a logic circuit for a function with n minterms.
That is, for each minterm in the minterm expansion of the function, OR the corresponding outputs of the decoder.
Fall 2010
Example: Using a 3-to-8 decoder, design a logic circuit to realize the following Boolean function F(A,B,C) = Sm(2, 3, 5, 6, 7)
Fall 2010
44
Example: Using two 2-to-4 decoders, design a logic circuit to realize the following Boolean function F(A,B,C) = Sm(0, 1, 4, 6, 7)
Fall 2010
45