# Decoder: Definition and Applications

## What is a Decoder?

In digital electronics, a combinational logic circuit that converts an N-bit binary input code into M output channels in such a way that only one output channel is activated for each one of the possible combinations of inputs is known as a decoder.

In other words, a combinational logic circuit which converts N input lines into a maximum of 2N output lines is called a decoder.

Therefore, a decoder is a combination logic circuit that is capable of identifying or detecting a particular code. The operation that a decoder performs is referred to as decoding. A general block diagram of a decoder is shown in Figure-1. Here, the decoder has N input lines and M (2N) output lines. In a decoder, each of the N input lines can be a 0 or a 1, hence the number of possible input combinations or codes be equal to 2N. For each of these input combinations, only one of the M output lines will be active, and all other output lines will remain inactive.

## Types of Decoders

There are several types of decoder present. But, based on the input and output lines present, decoders may classified into the following three types −

• 2 to 4 Decoder
• 3 to 8 Decoder
• 4 to 16 Decoder

Now, let us discuss each type of decoder in detail one by one.

### 2 to 4 Decoder

The 2 to 4 decoder is one that has 2 input lines and 4 (22) output lines. The functional block diagram of the 2 to 4 decoder is shown in Figure-2. When this decoder is enabled with the help of enable input E, then its one of the four outputs will be active for each combination of inputs. The operation of this 2-line to 4-line decoder can be analyzed with the help of its truth table which is given below.

Inputs Outputs
E A B 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

Using this truth table, we can derive the Boolean expression for each output as follows −

$$Y_{0}=E\cdot \bar{A}\cdot \bar{B}$$

$$Y_{1}=E\cdot \bar{A}\cdot B$$

$$Y_{2}=E\cdot A \cdot \bar{B}$$

$$Y_{3}=E\cdot A \cdot B$$

As each output term contains products of input variables that can be implemented with the help of AND gates. Therefore, the logic circuit diagram of the 2 to 4 decoder is shown in Figure-3. Operation − The operation of logic circuit of the 2 to 4 decoder is described as follows −

• When enable input (E) is inactive, i.e. set to 0, none of the AND gates will function.

• When enable input (E) is made active by setting it to 1, then the circuit works as explained below.

• When A = 0 and B = 0, the AND gate 1 becomes active and produces output Y0.

• When A = 0 and B = 1, the AND gate 2 becomes active and produces output Y1.

• When A = 1 and B = 0, the AND gate 3 becomes active and produces output Y2.

• When A = 1 and B = 1, the AND gate 4 becomes active and produces output Y3.

### 3 to 8 Decoder

The 3 to 8 decoder is one that has 3 input lines and 8 (23) output lines. The functional block diagram of the 3 to 8 decoder is shown in Figure-4. When this decoder is enabled with the help of enable input E, then it's one of the eight outputs will be active for each combination of inputs. The operation of this 3-line to 8-line decoder can be analyzed with the help of its function table which is given below.

Inputs Outputs
EABCY7Y6Y5Y4Y3Y2Y1Y0
0XXX00000000
100000000001
100100000010
101000000100
101100001000
110000010000
110100100000
111001000000
111110000000

Using this function table, we can derive the Boolean expression for each output as follows −

$$Y_{0}=E\bar{A}\bar{B}\bar{C}$$

$$Y_{1}=E\bar{A}\bar{B}C$$

$$Y_{2}=E\bar{A}B\bar{C}$$

$$Y_{3}=E\bar{A}BC$$

$$Y_{4}=EA\bar{B}\bar{C}$$

$$Y_{5}=EA\bar{B}C$$

$$Y_{6}=EAB\bar{C}$$

$$Y_{7}=EABC$$

As we can see, each output term contains products of input variables, hence they can be implemented with the help of AND gates. Therefore, the logic circuit diagram of the 3 to 8 decoder is shown in Figure-5. Operation − The operation of logic circuit of the 3 to 8 decoder is described as follows −

• When enable input (E) is inactive, i.e. set to 0, none of the AND gates will function.

• When enable input (E) is made active by setting it to 1, then the circuit works as described below.

• When A = 0, B = 0, and C = 0, the AND gate 1 becomes active and produces output Y0.

• When A = 0, B = 0, and C = 1, the AND gate 2 becomes active and produces output Y1.

• When A = 0, B = 1, and C = 0, the AND gate 3 becomes active and produces output Y2.

• When A = 0, B = 1, and C = 1, the AND gate 4 becomes active and produces output Y3.

• When A = 1, B = 0, and C = 0, the AND gate 5 becomes active and produces output Y4.

• When A = 1, B = 0, and C = 1, the AND gate 6 becomes active and produces output Y5.

• When A = 1, B = 1, and C = 0, the AND gate 7 becomes active and produces output Y6.

• When A = 1, B = 1, and C = 1, the AND gate 8 becomes active and produces output Y7.

### 4 to 16 Decoder

The 4 to 16 decoder is the type of decoder which has 4 input lines and 16 (214) output lines. The functional block diagram of the 4 to 16 decoder is shown in Figure-6. When this decoder is enabled with the help of enable input E, it's one of the sixteen outputs will be active for each combination of inputs. The operation of the 4-line to 16-line decoder can be analyzed with the help of its function table which is given below.

Inputs Output
EABCD
0XXXX0
10000Y0
10001Y1
10010Y2
10011Y3
10100Y4
10101Y5
10110Y6
10111Y7
11000Y8
11001Y9
11010Y10
11011Y11
11100Y12
11101Y13
11110Y14
11111Y15

From this function table, we can directly write the Boolean expression for each output as follows −

$$Y_{0}=E\bar{A}\bar{B}\bar{C}\bar{D}$$

$$Y_{1}=E\bar{A}\bar{B}\bar{C}D$$

$$Y_{2}=E\bar{A}\bar{B}C\bar{D}$$

$$Y_{3}=E\bar{A}\bar{B}CD$$

$$Y_{4}=E\bar{A}B\bar{C}\bar{D}$$

$$Y_{5}=E\bar{A}B\bar{C}D$$

$$Y_{6}=E\bar{A}BC\bar{D}$$

$$Y_{7}=E\bar{A}BCD$$

$$Y_{8}=EA\bar{B}\bar{C}\bar{D}$$

$$Y_{9}=EA\bar{B}\bar{C}D$$

$$Y_{10}=EA\bar{B}C\bar{D}$$

$$Y_{11}=EA\bar{B}CD$$

$$Y_{12}=EAB\bar{C}\bar{D}$$

$$Y_{13}=EAB\bar{C}D$$

$$Y_{14}=EABC\bar{D}$$

$$Y_{15}=EABCD$$

We can implement these output expression in the same way as we done for the 2 to 4 decoder and 3 to 8 decoder.

Now, let us discuss the applications of decoders.

## Applications of Decoders

Decoders are used in the cases where an output or a collection of outputs is to be activated only on the occurrence of a particular combination of input codes. Some important applications of decoders are listed below −

• Decoders are used for code conversions.

• Decoders are extensively used in memory systems of computers.

• Decoders are also used for de-multiplexing or data distribution.

• Decoders are also used in data routing applications where very short propagation delay is required.

• Decoder may also be used for timing or sequencing purposes.

• Decoders are also utilized to turn on and off digital devices at a specific time.

This is all about decoder and its applications in digital electronic systems.

Updated on: 19-Apr-2023

2K+ Views 