Sie sind auf Seite 1von 26

Decoders and Multiplexers

In this topic we will be covering

• Decoders
• Decoders in AHDL
• Multiplexers and demultiplexers
• Multiplexers in AHDL
• Bus buffers and tri-state buffers
Decoders and Multiplexers
Decoders
A decoder is a combinational logic circuit that converts
an n-bit input code into m output lines.
Each combination of the input selects only one of the
output lines.
The input binary number is said to be decoded by the
circuit.
If we ignore the control inputs, such as chip-enable, an
n-input decoder has 2n outputs. For example, a 3-input
decoder has 23 = 8 outputs.
Decoders and Multiplexers
Decoders
A two-line to four-line decoder and its truth table.

Y0 B A Y0 Y1 Y2 Y3
A 0 0 0 1 1 1
Y1
0 1 1 0 1 1
B Y2
1 0 1 1 0 1
Y3 1 1 1 1 1 0

Two-line to four-line decoder and truth table


Decoders and Multiplexers
Decoders
This decoder has an active-low output. A commonly
used 3-line to 8-line decoder is the 74LS138.
This device is designed especially for memory address
decoding and for data transmission. It has three binary
inputs and three chip-enable inputs.
Two of the chip-enable inputs are active-low and the
other is active-high.
The logic diagram, symbols and the function table are
shown in the following slide.
Decoders and Multiplexers
Decoders Y0
Y1
G1
Enable inputs G2A Y2
G2B Y3
Outputs
Y4
A Y5

Select inputs B Y6

C Y7

Standard symbol IEC symbol


DMUX
Y0 Y0
A Y1 A 0 Y1
B Y2 B G 70 Y2
C Y3 C 2 Y3
Y4 Y4
G1 Y5 G1 & Y5
G2A Y6 G2A Y6
G2B Y7 G2B Y7
Decoders and Multiplexers
Decoders
Decoders and Multiplexers
Decoders
Two or more 74138’s may be used to decode binary
inputs with more than three bits.
Example
Devise and sketch the schematic diagram of how two
74138’s may be used to decode a 4-bit binary input to
produce a 1-of-16 output.
Decoders and Multiplexers
Decoders
Solution
We do this by connecting three of the input-lines to the
inputs of both of the 74138’s.
The fourth input-line is connected to the G2A (or the
G2B) enable input of the first 74138 and to the G1
enable input of the second 74138.
The schematic circuit is shown on the following slide.
Decoders and Multiplexers
Decoders

A Y8 Y0
B Y9 Y1
C Y10 Y2
1 Y11 +5V Y3
Y12 2 Y4
D Y13 Y5
Y14 Y6
Y15 Y7

Schematic circuit
Apart from memory decoding, decoders are used in
many specialised applications. We will now look at two
of these: BCD-to-decimal decoders and BCD-to-7-
segment decoders.
Decoders and Multiplexers
BCD-to-decimal decoder and BCD-to-7-segment
decoder/driver
A BCD-to-decimal decoder converts a binary-coded-
decimal input to give an output that corresponds to the
decimal number. Such a decoder is also called a 4-line to
10-line decoder or a 1-of-10 decoder.
An example is the 74LS42. This 16-pin device has four
inputs called A, B, C, D, and ten outputs labelled 0 to 9.
Refer to a manufacturer’s data manual for details of the
pin diagram and the logic diagram for this device.
Decoders and Multiplexers
BCD-to-decimal decoder and BCD-to-7-segment
decoder/driver

74LS42 One-of-ten decoder


Decoders and Multiplexers
BCD-to-decimal decoder and BCD-to-7-segment
decoder/driver
Very often we like to be able to convert a BCD input to
give a direct display of the corresponding decimal
number.
This can be done using a BCD-to-7-segment
decoder/driver, such as the 7446 and 7447.
These devices have active-low outputs and can drive
common-anode LED’s directly.
Decoders and Multiplexers
BCD-to-decimal decoder and BCD-to-7-segment
decoder/driver
Common anode means that the anodes of all segments of
the 7-segment display are connected together. Each
segment is lit when its cathode is grounded.
Decoders and Multiplexers
BCD-to-decimal decoder and BCD-to-7-segment
decoder/driver

The logic symbols for these devices is shown below.

BI/RBO

RBI a BI/RBO : Blanking input/ripple


LT b blanking output
c
A d RBI : Ripple blanking input
B e
C f LT : Lamp test
D g

Various logic symbols


Decoders and Multiplexers
BCD-to-decimal decoder and BCD-to-7-segment
decoder/driver
The BI / RBO pin serves as an input to blank-off1 all the
segments or as ripple-blanking output. In normal
operations this pin is held at logic 1.

The (lamp-test) input allows us to test the display. When


a 0 is applied to this pin, all the display segments should
light up.

1The blanking input can also be used to control the intensity of the display by
applying a periodic pulse to it.
Decoders and Multiplexers
BCD-to-decimal decoder and BCD-to-7-segment
decoder/driver
+5V

Lamp-test f b
g
7446
A
Inputs B e c
C
D d

A 7446 driving a 7-segment LED display


Decoders and Multiplexers
Decoders with AHDL
There are different ways to create a decoder in AHDL.
The first is with the use of a CASE statement.
Decoders and Multiplexers
Decoders with AHDL
SUBDESIGN decoder
(
code[1..0] : INPUT;
out[3..0] : OUTPUT;
)
BEGIN
CASE code[] IS
WHEN 0 => out[] = B"0001";
WHEN 1 => out[] = B"0010";
WHEN 2 => out[] = B"0100";
WHEN 3 => out[] = B"1000";
END CASE;
END;
Decoders and Multiplexers
Decoders with AHDL
The CASE statement shows that when the input code is
in one of four possible states, then the output, out, is set
to the given bit pattern.
Another method is to use a TRUTH TABLE.
Decoders and Multiplexers
Decoders with AHDL
SUBDESIGN decoder1
(
code[1..0] : INPUT;
out[3..0] : OUTPUT;
)
BEGIN
TABLE
code[1..0] => out[3..0];
H"0" => B"0001";
H"1" => B"0010";
H"2" => B"0100";
H"3" => B"1000";
END TABLE;
END;
Decoders and Multiplexers
Decoders with AHDL
This is the same decoder using the TRUTH TABLE.
Note that the H denotes a hexadecimal number and B
denotes a binary number.
These have been used just to show what can be done.
Also note that with the last two methods, the output of
the decoder does not have to be that of a normal decoder.
Any output bit pattern could be used to create, for
instance, a 7 segment LED decoder.
Decoders and Multiplexers
Bus buffers and tri-state buffers
A bus is a collection of wires that carries digital data
from a source to a destination device in a digital system.
When the bus of a system is connected to more input
devices than the fan-out limit, we need to provide some
form of buffer between the output of the system and the
bus.
Such a buffer is called a bus buffer (or bus driver).
Decoders and Multiplexers
Bus buffers and tri-state buffers
It is in essence a current amplifier which boosts the fan-
out capability of the output.
Many are made as eight-way (or octal) buffers.
Some buffers are bi-directional, which means that they
are capable of sending signals on to, and receiving
signals from, the bus.
These are often called transceivers.
Decoders and Multiplexers
Bus buffers and tri-state buffers
Sometimes it is necessary to isolate a system from the
bus. We can do this by using buffers whose outputs can
enter into a high-impedance state (or hi-Z).
This means that the impedance (resistance) ‘looking’
into each output point is extremely large. There is,
therefore, practically no connection (isolation) between a
buffer and the bus that it drives.
Decoders and Multiplexers
Bus buffers and tri-state buffers
A buffer whose output (or outputs) can enter into a high-
impedance state is called a tri-state buffer. It is so-called
because it has 3-state1 outputs.
An example of a tri-state octal buffer is the 74LS241.
The logic symbol and logic diagram of this device are
shown on the next slide

1The three states are high, low and high-impedance.


Decoders and Multiplexers

74LS241 tri-state octal buffer

Das könnte Ihnen auch gefallen