Sie sind auf Seite 1von 27

Combinational Logic Design

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

 Notice they are minterms


EC381/Digital Systems I 4
Truth Table, 3-to-8 Decoder

 Notice they are minterms

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)

 When disabled, 1 output X


F
EN

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:

So pay attention… In using a decoder, it is useful to know


when the output is intended to be active high, or active
low!
EC381/Digital Systems I 10
Decoder Expansion

 A 2-to-4 Line decoder requires 4 (2-input) AND gates


 A 3-to-8 line decoder requires 8 (3-input) AND gates
 If we want to design a 6-to-64 line decoder then we
will need?
 64 (6-input) AND gates!
 Unfortunately, as decoders become larger, this
approach gives a high gate input count!
 If we have decoders with enables, we can use
multiple, small decoders to implement larger
decoders.

EC381/Digital Systems I 11
Decoder Expansion: Example

 4‐to‐16 decoder Using 3‐to‐8


decoders

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

 Implement logic circuits!


 Memory address lines
 Decoders are used in Micro
Computer Interfacing for
Keyboard and Display
applications.

EC381/Digital Systems I 15
Decoders as General-purpose Logic

 n:2n decoder implements any function of n variables


 With the variables used as control inputs
 Enable inputs tied to 1 and
 Appropriate minterms summed to form the function

Decoder generates appropriate


minterm based on control signals
(it "decodes" control signals)

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

 F1 = A' B C' D + A' B' C D + A B C D

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”

What if all inputs are zero?


EC381/Digital Systems I 23
Priority Encoder

EC381/Digital Systems I 24
K Map for a priority encoder

 X on input means we must satisfy for


both possibilities: 0, 1

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

Das könnte Ihnen auch gefallen