Decoder
Decoder
A decoder is a device which does the reverse operation of an encoder, undoing the encoding so
that the original information can be retrieved. The same method used to encode is usually just
reversed in order to decode. It is a combinational circuit that converts binary information from n input
lines to a maximum of 2
n
unique output lines.
A 2-to-4 line single-bit decoder
In digital electronics, a decoder can take the form of a multiple-input, multiple-output logic circuit that
converts coded inputs into coded outputs, where the input and output codes are different. e.g. n-to-2
n
binary code decimal decoders. Enable inputs must be on for the decoder to function, otherwise its
outputs assume a single "disabled" output code word. Decoding is necessary in applications such as
data multiplexing, 7 segment display and memory address decoding.
Example:
Using a 3-to-8 decoder, design a logic circuit to
realize the following Boolean function
F(A,B,C) =
m(2, 3, 5, 6, 7)
Example:
Using two 2-to-4 decoders, design a logic circuit
to realize the following Boolean function
F(A,B,C) =
m(0, 1, 4, 6, 7)
Exercise:
Design a 4-to-16 decoder using
2-to-4 decoders only.
Example: Construct a 3-to-8 decoder using two 2-to-4 deocders with enable
Inputs
Example: Decoder Implementation of a Full Adder
SUMS
Binary 2-to-4 decoder
4 to 10 line decoder
Example: 2-to-4 decoders
Let us discuss the operation and combinational circuit design of a decoder by taking the
specific example of a 2-to-4 decoder. It contains two inputs denoted by A1 and A0 and
four outputs denoted by D0, D1, D2, and D3 as shown in figure 2. Also note that A1 is the
MSB while A0 is the LSB.
Truth Table for 8-3 Decoder
Here's a table describing the behavior of an 8-3 decoder.
x
2
x
1
x
0
Operation
000 z
0
= 1
001 z
1
= 1
010 z
2
= 1
011 z
3
= 1
100 z
4
= 1
101 z
5
= 1
110 z
6
= 1
111 z
7
= 1
Truth Table for 2-4 Decoder
The truth table for the 3-8 decoder is quite large, so we write the one for a 2-4
decoder.
x
1
x
0
z
3
z
2
z
1
z
0
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 0 1 0 0 0
We can write the Boolean expression for each of the outputs. Since this is a
conventional truth table, we can write sum-of-products for each output. Since each
output only has one row with an output of 1, this results in a minterm.
z
3
= x
1
x
0
z
2
= x
1
\x
0
z
1
= \x
1
x
0
z
0
= \x
1
\x
0
DECODER WITH ENABLE
x
1
x
0
z
3
z
2
z
1
z
0
0 0 0 0 0 e
0 1 0 0 e 0
1 0 0 e 0 0
1 0 e 0 0 0
EXCERCISE
Suppose the output of a 3-8 decoder has z
4
= 1. What must the input bits be?
Since z
4
= 1, we know that output 4 is active, and the rest of the outputs are 0. Thus,
we write 4 in binary, using 3 bits (since there are 3 input bits), which is 100.
Thus, x
2
x
1
x
0
= 100. That is, x
2
= 1, x
2
= 0, x
0
= 0
TEST
The above information has been gathered from the internet.
The following website contains a lot of information with examples about decoders
http://faculty.kfupm.edu.sa/COE/elrabaa/coe200/Lessons/Lesson3_4.pdf