Decoder
A Decoder is a combinational circuit that has ‘n’ input lines and
maximum of 2n output lines.
One of these outputs will be active High based on the combination
of inputs present, when the decoder is enabled. That means
decoder detects a particular code.
The outputs of the decoder are nothing but the min terms of ‘n’
input variables lines, when it is enabled.
2 to 4 Decoder
Let 2 to 4 Decoder has two inputs A 1 & A0 and four outputs Y3, Y2, Y1 & Y0.
The block diagram of 2 to 4 decoder is shown in the following figure.
One of these four outputs will be ‘1’ for each combination of inputs when
enable, E is ‘1’. The Truth table of 2 to 4 decoder is shown below.
Enable Inputs Outputs
E A1 A0 Y3 Y2 Y1 Y0
0 x x 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
From Truth table, we can write the Boolean functions for each output as
Y3=E.A1.A0
Y2=E.A1.A0′
Y1=E.A1′.A0
Y0=E.A1′.A0′
Each output is having one product term. So, there are four product terms
in total. We can implement these four product terms by using four AND
gates having three inputs each & two inverters. The circuit diagram of 2
to 4 decoder is shown in the following figure.
Therefore, the outputs of 2 to 4 decoder are nothing but the min terms of
two input variables A1 & A0, when enable, E is equal to one. If enable, E is
zero, then all the outputs of decoder will be equal to zero.
Similarly, 3 to 8 decoder produces eight min terms of three input variables
A2, A1 & A0 and 4 to 16 decoder produces sixteen min terms of four input
variables A3, A2, A1 & A0.
Implementation of Higher-order Decoders
Now, let us implement the following two higher-order decoders using
lower-order decoders.
3 to 8 decoder
4 to 16 decoder
3 to 8 Decoder
3 to 8 decoder can be implemented by using 2 to 4 decoders.
2 to 4 Decoder has two inputs, A 1 & A0 and four outputs, Y3 to Y0.
Whereas, 3 to 8 Decoder has three inputs A 2, A1 & A0 and eight
outputs, Y7 to Y0.
We can find the number of lower order decoders required for
implementing higher order decoder using the following formula.
Required number of lower order decoders = m2/m1
Where,
m1 is the number of outputs of lower order decoder.
m2 is the number of outputs of higher order decoder.
Here, m1 = 4 and m2 = 8. Substitute, these two values in the above
formula.
Required number of 2 to 4 decoders = 8/4 = 2
Therefore, we require two 2 to 4 decoders for implementing one 3 to 8
decoder. The block diagram of 3 to 8 decoder using 2 to 4 decoders is
shown in the following figure.
The parallel inputs A1 & A0 are applied to each 2 to 4 decoder.
The complement of input A 2 is connected to Enable, E of lower 2 to 4
decoder in order to get the outputs, Y 3 to Y0. These are the lower
four min terms.
The input, A2 is directly connected to Enable, E of upper 2 to 4
decoder in order to get the outputs, Y 7 to Y4. These are the higher
four min terms.
4 to 16 Decoder
4 to 16 decoder can be implemented by using 3 to 8 decoders.
3 to 8 Decoder has three inputs A 2, A1 & A0 and eight outputs, Y7 to
Y0. Whereas, 4 to 16 Decoder has four inputs A 3, A2, A1 & A0 and
sixteen outputs, Y15 to Y0.
By formula for finding the number of lower order decoders required.
Required number of lower order decoders = m2/m1
m1 = 8 and m2 = 16 in the above formula.
Substitute,
Required number of 3 to 8 decoders = 16/8 = 2
Therefore, we require two 3 to 8 decoders for implementing one 4 to 16
decoder. The block diagram of 4 to 16 decoder using 3 to 8 decoders is
shown in the following figure.
The parallel inputs A2, A1 & A0 are applied to each 3 to 8 decoder.
The complement of input, A3 is connected to Enable, E of lower 3 to
8 decoder in order to get the outputs, Y 7 to Y0. These are the lower
eight min terms.
The input, A3 is directly connected to Enable, E of upper 3 to 8
decoder in order to get the outputs, Y 15 to Y8. These are the higher
eight min terms.
Encoder
An Encoder is a combinational circuit that performs the reverse
operation of Decoder.
It has maximum of 2n input lines and ‘n’ output lines.
It will produce a binary code equivalent to the input, which is active
High.
Therefore, the encoder encodes 2n input lines with ‘n’ bits.
It is optional to represent the enable signal in encoders.
4 to 2 Encoder
Let 4 to 2 Encoder has four inputs Y 3, Y2, Y1 & Y0 and two outputs A1 & A0.
The block diagram of 4 to 2 Encoder is shown in the following figure.
At any time, only one of these 4 inputs can be ‘1’ in order to get the
respective binary code at the output. The Truth table of 4 to 2 encoder is
shown below.
Inputs Outputs
Y3 Y2 Y1 Y0 A1 A0
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
From Truth table, we can write the Boolean functions for each output as
A 1 = Y3 + Y2
A 0 = Y3 + Y1
We can implement the above two Boolean functions by using two input OR
gates. The circuit diagram of 4 to 2 encoder is shown in the following
figure.
The above circuit diagram contains two OR gates. These OR gates encode
the four inputs with two bits
Octal to Binary Encoder (8 to 3 Encoder)
Octal to binary Encoder has eight inputs, Y 7 to Y0 and three outputs
A2, A1 & A0.
Octal to binary encoder is nothing but 8 to 3 encoder.
The block diagram of octal to binary Encoder is shown in the
following figure.
At any time, only one of these eight inputs can be ‘1’ in order to get the
respective binary code. The Truth table of octal to binary encoder is
shown below.
Inputs Outputs
Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 A2 A1 A0
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
From Truth table, we can write the Boolean functions for each output as
A 2 = Y7 + Y6 + Y5 + Y4
A 1 = Y7 + Y6 + Y3 + Y2
A 0 = Y 7 + Y 5+ Y 3 + Y 1
We can implement the above Boolean functions by using four input OR
gates. The circuit diagram of octal to binary encoder is shown in the
following figure.
The above circuit diagram contains three 4-input OR gates. These OR
gates encode the eight inputs with three bits.
Uses of Encoders:
1. These systems are very easy to use in all digital systems.
2. Encoders are used to convert a decimal number into the binary
number. The objective is to perform a binary operation such as
addition, subtraction, multiplication, etc.