Beruflich Dokumente
Kultur Dokumente
Lecture 12
Topics
Decoders
Encoders
Priority Encoders
EC381/Digital Systems I 2
Decoders
Typically n inputs and 2n outputs
Drives high the output corresponding to
binary code of input
74139
EC381/Digital Systems I 3
2-to-4 Line Decoder
EC381/Digital Systems I 5
3-to-8 Line Decoder Schematic
EC381/Digital Systems I 6
Enabling Function
Enabling: permits an input signal to pass
through to an output
Disabling: blocks an input signal from passing
through to an output, replacing it with a fixed
value
The value on the output when it is disable can
be Hi-Z (as for three-state buffers and
transmission gates), 0 , or 1 X
F
EN
When disabled, 0 output (a)
Combinational
(b) Logic
2-to-4 Decoder with Enable
EC381/Digital Systems I 8
Enable Used for Expansion
EC381/Digital Systems I 9
Variations
Sometimes, in implementation decoders are done with
NAND gates rather than AND gates.
With NAND gates, the table illustrating the decoder
operation would look like this:
EC381/Digital Systems I 11
Decoder Expansion: Example
EC381/Digital Systems I 12
Decoder Expansion – Example
When w =0, the
top decoder is
enabled and the
other is disabled.
The bottom
decoder outputs
are all 0’s, and
the top eight
outputs generate
minterms
0000 to 0111.
When w = 1, the
enable conditions
are reversed
EC381/Digital Systems I 13
Example decoder tree: 4‐to‐16
decoder Using 2‐to‐4 decoders
EC381/Digital Systems I 14
Uses for Decoders
EC381/Digital Systems I 15
Decoders as General-purpose Logic
EC381/Digital Systems I 16
Decoders as General-purpose
Logic
Example: Implement the following boolean functions
1. S(x,y,z) = SUM(m(1,2,4,7))
2. C(x,y,z) = SUM(m(3,5,6,7))
EC381/Digital Systems I 17
Example
0 A'B'C'D'
1 A'B'C'D
2 A'B'CD' F1
3 A'B'CD
4 A'BC'D'
5 A'BC'D
6 A'BCD'
4:16 7 A'BCD
Enable DEC 8 AB'C'D'
9 AB'C'D
10 AB'CD'
11 AB'CD
12 ABC'D'
13 ABC'D
14 ABCD'
15 ABCD
A B C D
EC381/Digital Systems I 18
Encoder
Encoder is the opposite of decoder
2n inputs
n outputs
EC381/Digital Systems I 19
Truth Table
EC381/Digital Systems I 20
Inputs are Minterms
A0 = D1 + D3 + D5 + D7
EC381/Digital Systems I 21
What’s the Problem?
What if D3 and D6 both high?
Simple OR circuit will set A to 7
Solution?
EC381/Digital Systems I 22
Priority Encoder
Chooses one with highest priority
Largest number, usually
Note “don’t cares”
EC381/Digital Systems I 24
K Map for a priority encoder
Valid (V) is OR
of inputs
EC381/Digital Systems I 25
K Map for a priority encoder
EC381/Digital Systems I 26
Logic Diagram of a 4-input Priority
Encoder
EC381/Digital Systems I 27