Uploaded by Ibrahim Alhaiek

Chapter6 - MUXs and Decoders

advertisement
Electrical and Microelectronic Engineering
Rochester Institute of Technology
EEEE120: Digital Systems I
Chapter 6
Multiplexers
Decoders
Encoders
03/27/2023
2
Multiplexers
03/27/2023
3
Reminder: 2-to-1 and 4-to-1 MUX
s
w0
w1
0
f
1
s
f
0
1
w0
w1
s1
s0
s0
s1
w0
0
w1
1
0
1
w2
0
w3
1
w0
w1
w2
w3
s1 s0
00
01
10
11
f
0
0
1
1
0
1
0
1
f
w0
w1
w2
w3
f
03/27/2023
4
Reminder: 16-to-1 MUX
s0
s1
w0
w3
w4
s2
s3
w7
f
w8
w11
w12
w15
03/27/2023
5
Synthesis through MUX
Naive approach (reminder):
- Needs large MUXes
- Variables are only
used as select
Modified approach:
- Efficient, smaller Muxes
- Variables used as input
and select
LSB: input
w1 w2
0
0
0
1
1
1
0
1
1
1
0
w1 w2
f
0
w2
w1
f
0
0
0
0
1
1
1
0
1
1
1
0
0
1
1
0
f
w1
f
0
w2
1
w2
w1
w2
f
03/27/2023
6
Another Example
w1 w2 w3
Naive approach (reminder):
- Needs large MUXes
- Variables are only
used as select
More efficient
(use 4-to-1 MUX)
LSB: input
w1 w2 w3
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
f
0
0
0
1
0
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
f
0
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
?
w1 w2
0
0
1
1
0
1
0
1
w2
w1
f
0
0
w3
w3
w3
1
1
f
03/27/2023
7
Another Example
w1 w2 w3
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
f
0
1
1
0
1
0
0
1
w3
w3
w3
w2
w1
w3
f
w3
03/27/2023
8
Decoders
03/27/2023
9
Decoders
Input: a binary value
Output: its representative
For n inputs we have 2n outputs
Example (2 to 22=4 decoder):
w1 w0
0
0
1
1
w0
w1
0
1
0
1
called one-hot
y0 y1 y2 y3
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
w0
w1
y0
y1
y2
y3
y0
y1
y2
y3
03/27/2023
10
Decoders
3-to-8 Line Decoder
03/27/2023
11
Synthesis of Functions
Different approaches can be used to synthesize functions:
E.g., F(w2,w1,w0)=  m(2, 4, 5, 6)
You already know how to use K-map and get SOP/POS and then
NAND only or NOR only
1. Naïve MUX approach (use 8 to 1 MUX)
2. Modified MUX approach (use 4 to 1 MUX)
3. Decoder (see next page)
03/27/2023
12
Synthesis of Functions
Decoders can be used to synthesize functions:
F(w2,w1,w0)=  m(2, 4, 5, 6)
w0
y0
w1
y1
w2
y2
y3
y4
y5
y6
y7
03/27/2023
13
Encoders
A binary encoder encodes information from 2n inputs into an nbit code
• Encoders are used to reduce the number of bits needed to represent given
information.
• A practical use of encoders is for transmitting information in a digital system.
Encoding the information allows the transmission link to be built using fewer
wires.
• Encoding is also useful if information is to be stored for later use because
fewer bits need to be stored.
03/27/2023
14
Encoders
Input: only one bit (one-hot)
Output: binary value = identifier
For 2n inputs we have n outputs
4 to 2 encoder:
w0
w3 w2 w1 w0
0
0
0
1
0
0
1
0
0
1
0
0
1
0
0
0
y1 y0
0
0
1
1
0
1
0
1
w1
y0
w2
w3
y1
Why this circuit? Observe that the output y0 is 1 when either
input w1 or w3 is 1, and output y1 is 1 when input w2 or w3 is 1
K-map with 12 don’t cares
Benefits of encoders?
Storage of log2 n bits instead of n bits
03/27/2023
15
Priority Encoders
A variant of encoder which acts on just the bit with higher
significance and ignores those with lower significance
w3 w2 w1 w0
0
0
0
0
1
0
0
0
1
x
0
0
1
x
x
0
1
x
x
x
y1 y0
d
0
0
1
1
d
0
1
0
1
d: don’t care (we have just one d)
x: ignore
Note: many combinations are not shown in this table
03/27/2023
16
Priority Encoders
A variant of encoder which acts on just the bit with higher
significance and ignores those with lower significance
w3 w2 w1 w0
0
0
0
0
1
0
0
0
1
x
0
0
1
x
x
0
1
x
x
x
y1 y0
d
0
0
1
1
d
0
1
0
1
d: don’t care (we have just one d)
x: ignore
Consider the last row in the truth table. It specifies that if input w3 is 1, then
the outputs are set to y1y0 = 11. Because w3 has the highest priority level, the
values of inputs w2, w1, and w0 do not matter; w2, w1, and w0 are x in the truth
table. In the second-last row in the truth table w2 = 1 and the outputs are set
to y1y0 = 10, but only if w3 = 0. Similarly, input w1 causes the outputs to be set
to y1y0 = 01 but only if both w3 and w2 are 0. Finally, input w0 produces the
outputs y1y0 = 00 if and only if w0 is the only input asserted.
03/27/2023
17
Download