EEE3821 Chapter7 Decoder MUX

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

Combinational logic circuits

Chapter 3

EEE3821
DIGITAL CIRCUITS
CHAPTER 7 ENCODERS & MULTIPLEXERS

1
 to explain and analyse decoders & encoders in digital
circuits applications.

 to explain and analyse operation of multiplexers and


demultiplexers in digital circuit applications.

Digital Systems: Principles and Applications, 11/e Ronald J. Tocci,


2
Neal S. Widmer, Gregory L. Moss
Introduction
• Digital systems obtain data and information continuously
operated on in some manner:
• Decoding/encoding.
• Multiplexing/demultiplexing.
• These and other operations have been facilitated by the
availability of numerous ICs in the MSI (medium-scale-
integration) category.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Decoders
• Decoders are used when an output or a group of outputs is to be
activated only on the occurrence of a specific combination of
input levels.
• Often provided by outputs of a counter or a register.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Decoders
• A decoder accepts a set of inputs that represents a binary number—activating
only the output that corresponds to the input number.

For each of these


input combinations,
only one of the M
outputs will be
active (HIGH); all the
other outputs are
LOW.

Many decoders are designed to produce active-LOW outputs,


where only the selected output is LOW while all others are HIGH.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Decoders
Circuitry for a decoder with three inputs and 8 outputs.

It uses all AND gates, so


outputs are active-HIGH

Output O6 goes HIGH only


when CBA 1102 = 610.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Decoders
Circuitry for a decoder with three inputs and 8 outputs.

This can be called a 3-line-to-8-line


decoder—it has three input lines
and eight output lines.

Also called a binary-to-octal


decoder or converter—taking
three-bit binary input code
and activating one of eight
(octal) outputs.

Also referred to as a 1-of-8


decoder—only 1 of the 8 outputs
is activated at one time.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Decoders
• Some decoders have one or more enable inputs used to control
the operation of the decoder.
• The decoder is enabled only if ENABLE is HIGH.
• With common ENABLE line connected to a fourth input of each
gate:
• If ENABLE is HIGH, the decoder functions normally.
• A, B, C input will determine which output is HIGH.
• If ENABLE is LOW, all outputs will be forced LOW.
• Regardless of the levels at the A, B, C inputs.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Decoders
The 74ALS138 decoder.

ENABLE
inputs

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Example:
Indicate the states of the 74ALS138 output for each of the
following sets of inputs.
(a) E3= E’2=1, E’1=0, A2=A1=1, A0=0
(b) E3= 1, E’2= E’1=0, A2= 0, A1=A0=1
solutions:

(a)With E’2=1, the decoder is disabled and all of its output will
be in their inactive HIGH state.
(b) All of the enable inputs are activated, so the decoding portion
is enabled. It will decode the input code 0112=310 to activate the
output O’3.This the O’3 will be LOW and all other outputs will be
HIGH.

10
Decoders

7442
BCD-to-decimal
decoder.

This decoder
does not have
an enable input.

Each output goes LOW only when its


corresponding BCD input is applied.
Also called 4-to10 decoder or 1-of-10
decoder Digital Systems: Principles and Applications, 11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Decoders
7445 BCD-to-decimal decoder/driver.

Suitable for directly


driving loads such
as indicator LEDs
or lamps, relays,
or dc motors.
Termed a driver because this IC
has open-collector outputs that
operate at higher current/voltage
limits than a normal TTL output.
When the decoder inputs come from a
counter that is being continually pulsed,
the decoder outputs will be activated
sequentially and they can be used as
timing or sequencing signals to turn
devices on or off at specific times.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
The timing diagram shows the sequence of events. If we
assume that the counter is in the 0000 state at time 0, then
both outputs O’3 and O’6 are initially in the inactive HIGH state,
where their output transistors are off and both relays are de-
energized. As clock are applied the counter will be
incremented once per second. On third pulse, the counter
goes 0011 (3) state, so O’3 is activated and relay K1 energized.
On forth pulse, the counter goes to the 0100 (4) state, O’3 will
deactivate and de-energize relay K1.

Similarly at time 6, the counter will go to the 0110 (6) state,


this will make O’6 = 0 and energize K2. At time 7, the counter
goes to 0111(7) and deactivate O6 and de-energize K2.

13
Review Questions :

1. Can more than one decoder output be activated at one time?


2. What is the function of a decoder ‘s enable input(s)?
3. How does the 7445 differ from the 7442?
4. The 74154 is a 4-to-16 decoder with two active –LOW enable inputs. How
many pins (including power and ground) does this IC have?

Solutions:

1. No
2. To enable input controls whether or not the decoder logic responds to
the input binary code
3. 7445 has open-collector output that can handle up to 30V and 80 mA.
4. 24 pins : 2 enables, 4 inputs, 16 outputs, Vcc and ground.

14
BCD-to-7 Segment Decoder/Drivers
• The 7-segment display is a common way to display decimal or hexadecimal
characters.
• One common arrangement uses light emitting diodes (LEDs) for each segment.

By controlling current through each LED,


some segments are turned on & emit light,
while others are turned off, which
generates the desired character pattern.
Digital Systems: Principles and Applications, 11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
BCD-to-7 Segment Decoder/Drivers
• The 7-segment display is a common way to display decimal or
hexadecimal characters.
• One common arrangement uses light emitting diodes (LEDs) for each segment.

Diodes allow current to flow in one direction,


but block flow in the other direction.
When the LED anode is more positive than the cathode
by approximately 2 V, the LED will light up.
Digital Systems: Principles and Applications, 11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
BCD-to-7 Segment Decoder/Drivers
BCD-to-7-segment decoder/driver.

The 7446/47
activates specific
segment patterns
in response to
input codes

Digital Systems: Principles and


Applications, 11/e
Ronald J. Tocci, Neal S. Widmer,
Gregory L. Moss
To illustrate. Let us suppose that the BCD input is D=0, C=0, B=
1, A=1, which is BCD for 3. With these inputs the decoder
outputs a’,b’,g’,c’ and d’ will be driven LOW, allowing current to
flow through the a, b, g ,c and d LED segments and thereby
displaying the numeral 3.

The f’ and e’ outputs will be HIGH (open) so that LED


segments f and e cannot conduct.

18
BCD-to-7 Segment Decoder/Drivers

This is a common-
anode LED display.
The anodes all of
segments are tied
together to VCC .

Another type uses a common-cathode method, with


each segment requiring 10 to 20 mA of current.
TTL/CMOS devices are normally not used to drive a common-
cathode display directly—a transistor interface circuit is often used
Digital Systems: Principles and
Applications, 11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L.
Moss
Encoders
• The opposite of decoding process is encoding.
• Performed by a logic circuit called an encoder.

An encoder has a number of


input lines, only one of which
is activated at a given time.

Shown is an encoder with M


inputs and N outputs.

Inputs are active-HIGH,


which means that they
are normally LOW.

It produces an N-bit output


code, depending on which
input is activated.
Digital Systems: Principles and Applications, 11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Encoders
• An octal-to-binary encoder (8-line-to-3-line encoder) accepts
eight input lines, producing a three-bit output code
corresponding to the input.

Logic circuit for an octal-to-binary (8-line-to-3 line)


encoder. Only one input should be active at one time.
Digital Systems: Principles and Applications, 11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Encoders
• A priority encoder ensures that when two or more inputs are activated, the
output code will correspond to the highest-numbered input.

It has nine active-LOW inputs represent decimal digits


1 through 9, producing inverted BCD code corresponding
to the highest-numbered activated input.
Digital Systems: Principles and Applications,
11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L.
Moss
Encoders
• A switch encoder can be used when BCD data must be entered
manually into a digital system.
• The 10 switches might be the keyboard switches
on a calculator—representing digits 0 through 9.

Digital Systems: Principles and


Applications, 11/e
Ronald J. Tocci, Neal S. Widmer,
Gregory L. Moss
Encoders
The switches are of the
normally open type, so
the encoder inputs are
all normally HIGH.

BCD output is 0000.

When a key is depressed, the


circuit will produce the BCD
code for that digit.

The 74LS147 is a priority


encoder, so simultaneous
key depressions produce the
BCD code for the higher-
numbered key.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Review Questions

1. How does an encoder differ from a decoder?


2. How does a priority encoder differ from the ordinary
encoder?
3. What will the outputs of switch encoder be in when SW6,
SW5 and SW2 are all closed?

solution
1. An encoder produces an output code corresponding to the activated input. A
decoder activates one output corresponding to an applied input code.
2. In priority encoder, the output code corresponds to the highest-numbered input
that is activated.
3. Normal BCD=0110

25
Multiplexers (Data Selectors)
• A multiplexer (MUX) selects 1 of N input data sources and transmits the
selected data to a single output—called multiplexing.
• A digital multiplexer or data selector is a logic circuit that performs the same task.

Routing control of desired data


input to output by SELECT
inputs—referred to as
ADDRESS inputs.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Multiplexers (Data Selectors)
• A two-input MUX could be used in a digital system that uses two
different MASTER CLOCK signals.
• A high-speed clock in one mode and a slow-speed clock for the other.

Digital Systems: Principles and


Applications, 11/e
Ronald J. Tocci, Neal S. Widmer,
Gregory L. Moss
Multiplexers (Data Selectors)
• Two-, four-, eight-, and 16-input multiplexers are available in the TTL
and CMOS logic families.
• These basic ICs can be combined for multiplexing
a larger number of inputs.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Multiplexers (Data Selectors)
The 74ALS157 contains four two-input multiplexers

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Example
Determine the input conditions required for each Z output of
74ALS157 to take on the logic level of its corresponding I0 input.
Repeat with I1.

Solutions:

The enable input must be active; E’=0. In order for Za to equal Ioa,
the select input must be LOW. These same conditions will produce
Zb=Iob, Zc=Ioc, Zd=Iod
With E’=0, S=1, the outputs will follow the set of I1 inputs; that is
Za= I1a Zb=I1b, Zc=I1c, Zd=I1d

30
Other types of Mux:

 8-input MUX (74HC151 IC )


 16-input MUX (uses two 74HC151 IC )

Read from the text book

31
Multiplexer Applications
• Multiplexer circuits find numerous and varied applications in digital
systems of all types.
• Data selection/routing, parallel-to-serial conversion.
• Operation sequencing.
• Waveform/logic-function generation.

Digital Systems: Principles and


Applications, 11/e
Ronald J. Tocci, Neal S. Widmer,
Gregory L. Moss
Multiplexer Applications - Data
selection/routing
S=1, output from Select and
Counter 1 will be display the
allowed to pass contents of
through the Mux either of two
to decoder to be counters using a
displayed on the single set of
LED readouts. decoder and LED
displays.

System for
S=0, output from displaying two
Counter 2 will be multi digit BCD
allowed to pass counters one at
through the Mux a time.
to decoder to be
displayed on the
LED readouts.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Multiplexer Applications
Parallel-to-serial converter.

Waveforms for
X7X6X5X4X3X2X1X0
A three-bit
counter is used 10110101
to provide the
select code bits The LSB (X0) is transmitted
S2S1S0. (cycle first and the MSB (X7) is
from 000 – 111) transmitted last.
Digital Systems: Principles and
Applications, 11/e
Ronald J. Tocci, Neal S. Widmer,
Gregory L. Moss
Multiplexer Applications
Multiplexer used to implement a logic
function described by the truth table.

Select inputs are used as the logic variables, each


data input is connected permanently HIGH or LOW
as necessary to satisfy the truth table. Digital Systems: Principles and Applications, 11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Review Questions
1. What are some of the major applications of multiplexers?
2. True or False : When a multiplexer is used to implement a
logic function, the logic variables are applied to the
multiplexer’s data inputs.
3. What type of circuit provides the select inputs when a MUX is
used as a parallel-to-serial converter?
Solutions:

1. parallel-serial conversion, data routing, logic function generation, operations


sequencing
2. False, they are applied to the select inputs
3. Counter

36
Demultiplexers (Data Distributors)
• A demultiplexer (DEMUX) takes a single input and distributes it
over several outputs.
• The select input code determines to which output
the DATA input will be transmitted.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Demultiplexers (Data Distributors)

A 1 line to 8 line
demultiplexer.

This demux is very


similar to the 3-line-
to-8-line decoder S S S =000, only AND gate 0 is
2 1 0
circuit enabled, and data input I will Digital Systems: Principles and Applications, 11/e
Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
appear at output O0.
Demultiplexers (Data Distributors)
Security monitoring system using the 74ALS138.
Security monitoring system in an industrial plant where open/closed status of
many access doors to be monitored. The LEDs are mounted on a remote
monitoring panel at the security guard’s station.

The system shown


can handle eight
doors, but can be
expanded to
any number.

The door switches


are data inputs
to the MUX.

They produce a
HIGH when a door
is open and a LOW
when it is closed.

Digital Systems: Principles and


Applications, 11/e
Ronald J. Tocci, Neal S. Widmer,
Gregory L. Moss
Example
For example, the counter is at the count of 110 (6). While the
counter is in this state, let’s say the door 6 is closed. The LOW
at I6 will pass through the MUX and be inverted to produce
HIGH at Z’. This HIGH will pass through the DEMUX to output
O6’ so that the LED 6 will be off, indicating the door 6 is
closed. Now, let’s say that door is open. A LOW will appear
at Z’ and O6’ so that LED 6 will be on to signal that door 6 is
open. Of course, all other LEDs will be off during this time
because O6’ is the only active output.

40
Demultiplexers (Data Distributors)
Synchronous data transmission system

A synchronous data
transmission system that is
used to transmit four, four-
bit words serially from a
transmitter to a remote
receiver.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Demultiplexers (Data Distributors)

Synchronous data
transmission
system
receiver block

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Demultiplexers (Data Distributors)
This timing diagram shows the parallel data loaded into the transmitter, the
serial data stream, and distribution/storage
of the four data values in the receiver registers.

Digital Systems: Principles and Applications, 11/e


Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss
Review Questions
1. Explain the difference between a DEMUX and a MUX
2. True or False : The circuit for a DEMUX is basically the same as
for a decoder
3. For the system in security monitoring system figure, what will
the security guard see on the monitoring panel when all of the
doors are open?
Solution:

1. A MUX selects one of many inputs signals to be passed to its output; a DEMUX
selects one of many outputs to receive the input signal.
2. True; provided that the decoder has an ENABLE input
3. The LEDs will go on and off in sequence

44
Question
Consider the system of security monitoring system as in
previous slide. Assume that the clock frequency is 10 pps.
Describe what the monitoring panel indications will be for
each of the following cases.

(a)All of doors closed


(b)All doors open
(c)Doors 2 and 6 open

45

You might also like