An encoder is a digital circuit that converts a set of binary inputs into a unique binary code. The binary code represents the position of the input and is used to identify the specific input that is active. Encoders are commonly used in digital systems to convert a parallel set of inputs into a serial code.
What is Encoder?
An Encoder is a combinational circuit that performs the reverse operation of a Decoder. It has a maximum of 2^n input lines and ‘n’ output lines, hence it encodes the information from 2^n inputs into an n-bit code. It will produce a binary code equivalent to the input, which is active High. Therefore, the encoder encodes 2^n input lines with ‘n’ bits.
The basic principle of an encoder is to assign a unique binary code to each possible input. For example, a 2-to-4 line encoder has 2 input lines and 4 output lines and assigns a unique 4-bit binary code to each of the 2^2 = 4 possible input combinations. The output of an encoder is usually active low, meaning that only one output is active (low) at any given time, and the remaining outputs are inactive (high). The active low output is selected based on the binary code assigned to the active input.
There are different types of encoders, including priority encoders, which assign a priority to each input, and binary-weighted encoders, which use a binary weighting system to assign binary codes to inputs. In summary, an encoder is a digital circuit that converts a set of binary inputs into a unique binary code that represents the position of the input. Encoders are widely used in digital systems to convert parallel inputs into serial codes.

Encoder
Types of Encoders
There are different types of Encoders which are mentioned below.
- 4 to 2 Encoder
- Octal to Binary Encoder (8 to 3 Encoder)
- Decimal to BCD Encoder
- Priority Encoder
4 to 2 Encoder
The 4 to 2 Encoder consists of four inputs Y3, Y2, Y1 & Y0, and two outputs A1 & A0. At any time, only one of these 4 inputs can be ‘1’ in order to get the respective binary code at the output. The figure below shows the logic symbol of the 4 to 2 encoder.

4 to 2 Encoder
The Truth table of 4 to 2 encoders is as follows.
| 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 |
Logical expression for A1 and A0:
A1 = Y3 + Y2
A0 = Y3 + Y1
The above two Boolean functions A1 and A0 can be implemented using two input OR gates :

Implementation using OR Gate
Octal to Binary Encoder (8 to 3 Encoder)
The 8 to 3 Encoder or octal to Binary encoder consists of 8 inputs: Y7 to Y0 and 3 outputs: A2, A1 & A0. Each input line corresponds to each octal digit value and three outputs generate corresponding binary code. The figure below shows the logic symbol of octal to the binary encoder.

Octal to Binary Encoder (8 to 3 Encoder)
The truth table for the 8 to 3 encoder is as follows.
| 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 |
Logical expression for A2, A1, and A0.
A2 = Y7 + Y6 + Y5 + Y4
A1 = Y7 + Y6 + Y3 + Y2
A0 = Y7 + Y5 + Y3 + Y1
The above two Boolean functions A2, A1, and A0 can be implemented using four input OR gates.

Implementation using OR Gate
Decimal to BCD Encoder
The decimal-to-binary encoder usually consists of 10 input lines and 4 output lines. Each input line corresponds to each decimal digit and 4 outputs correspond to the BCD code. This encoder accepts the decoded decimal data as an input and encodes it to the BCD output which is available on the output lines. The figure below shows the logic symbol of the decimal to BCD encoder :

Decimal to BCD Encoder
The truth table for decimal to BCD encoder is as follows.
| INPUTS |
OUTPUTS |
| Y9 |
Y8 |
Y7 |
Y6 |
Y5 |
Y4 |
Y3 |
Y2 |
Y1 |
Y0 |
A3 |
A2 |
A1 |
A0 |
| 0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
| 0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
1 |
| 0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
1 |
0 |
| 0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
| 0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
| 0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
| 0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
| 0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
| 0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
| 1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
Logical expression for A3, A2, A1, and A0.
A3 = Y9 + Y8
A2 = Y7 + Y6 + Y5 +Y4
A1 = Y7 + Y6 + Y3 +Y2
A0 = Y9 + Y7 +Y5 +Y3 + Y1
The above two Boolean functions can be implemented using OR gates.

Implementation using OR Gate
Priority Encoder
A 4 to 2 priority encoder has 4 inputs: Y3, Y2, Y1 & Y0, and 2 outputs: A1 & A0. Here, the input, Y3 has the highest priority, whereas the input, Y0 has the lowest priority. In this case, even if more than one input is ‘1’ at the same time, the output will be the (binary) code corresponding to the input, which is having higher priority. The truth table for the priority encoder is as follows.
| INPUTS |
OUTPUTS |
| Y3 |
Y2 |
Y1 |
Y0 |
A1 |
A0 |
V |
| 0 |
0 |
0 |
0 |
X |
X |
0 |
| 0 |
0 |
0 |
1 |
0 |
0 |
1 |
| 0 |
0 |
1 |
X |
0 |
1 |
1 |
| 0 |
1 |
X |
X |
1 |
0 |
1 |
| 1 |
X |
X |
X |
1 |
1 |
1 |
The logical expression for A1 is shown below.

Logical Expression
The Logical Expression for A0 is shown below.

Logical Expression
The above two Boolean functions can be implemented as.

Priority Encoder
There are some errors that usually happen in Encoders are mentioned below.
- There is an ambiguity, when all outputs of the encoder are equal to zero.
- If more than one input is active High, then the encoder produces an output, which may not be the correct code.
So, to overcome these difficulties, we should assign priorities to each input of the encoder. Then, the output of the encoder will be the code corresponding to the active high inputs, which have higher priority.
Application of Encoders
- Encoders are very common electronic circuits used in all digital systems.
- Encoders are used to translate the decimal values to the binary in order to perform binary functions such as addition, subtraction, multiplication, etc.
- Other applications especially for Priority Encoders may include detecting interrupts in microprocessor applications.
Advantages of Encoders in Digital Logic
- Reduction in the number of lines: Encoders reduce the number of lines required to transmit information from multiple inputs to a single output, which can simplify the design of the system and reduce the cost of components.
- Improved reliability: By converting multiple inputs into a single serial code, encoders can reduce the possibility of errors in the transmission of information.
- Improved performance: Encoders can enhance the performance of a digital system by reducing the amount of time required to transmit information from multiple inputs to a single output.
Disadvantages of Encoders in Digital Logic
- Increased complexity: Encoders are typically more complex circuits compared to multiplexers , and require additional components to implement.
- Limited to specific applications: Encoders are only suitable for applications where a parallel set of inputs must be converted into a serial code.
- Limited flexibility: Encoders are limited in their flexibility, as they can only encode a fixed number of inputs into a fixed number of outputs.
Conclusion
Here we have learned about encoder on digital logic that ,an encoder is a device in digital electronics that takes multiple input signals and turns them into a smaller, coded output. Encoders are used in things like keyboards or communication systems to send or store information in a more compact way. We have learned about types of encoder, advantages disadvantages and applications of it. This helps make systems more efficient and less complex.
Frequently Asked Questions on Encoder in Digital Logic- FAQ’s
What is a Priority Encoder?
A priority encoder is a special type of encoder where, if multiple inputs are active, the output corresponds to the highest-priority (i.e., the input with the largest number). It also produces a valid output when no inputs are active.
Can an encoder handle multiple active inputs?
Standard encoders may not handle multiple active inputs correctly unless it’s a priority encoder. In a regular encoder, the output corresponds to the first active input, while a priority encoder gives priority to the highest active input.
What is the Difference between an Encoder and a Decoder?
- Encoder: Converts multiple input signals into a smaller set of output signals (coded form).
- Decoder: Does the opposite—converts a coded input back into a larger set of outputs.
GATE CS Corner Questions
Practicing the following questions will help you test your knowledge. All questions have been asked in GATE in previous years or in GATE Mock Tests. It is highly recommended that you practice them.
- GATE CS 2013, Question 65
- GATE CS 2014 (Set 3), Question 65
Dreaming of M.Tech in IIT? Get AIR under 100 with our GATE 2026 CSE & DA courses! Get flexible weekday/weekend options, live mentorship, and mock tests. Access exclusive features like All India Mock Tests, and Doubt Solving—your GATE success starts now!
Similar Reads
Verilog Priority Encoder
In Digital System Circuit, an Encoder is a combinational circuit that takes 2n input signal lines and encodes them into n output signal lines. When the enable is true i.e., the corresponding input signal lines display the equivalent binary bit output. What is Priority Encoder?A Priority Encoder is a digital circuit which encodes the input signals
7 min read
Difference Between Encoder and Decoder
Combinational Logic is the concept in which two or more input states define one or more output states. The Encoder and Decoder are combinational logic circuits. In which we implement combinational logic with the help of boolean algebra. To encode something is to convert in piece of information into a form of code that is not so clearly understood a
9 min read
Difference between Programmable Logic Array and Programming Array Logic
Programmable Logic Array (PLA) and Programming Array Logic (PAL) are the categories of programming logic devices. In PLA or Programmable Logic Array, there are massive functions can be implemented. Whereas in PAL or Programmable Array Logic, there is finite functions can be implemented. The distinction between PLA and PAL is that, PAL have programm
5 min read
Difference between SOP and POS in Digital Logic
In digital logic, the inputs and output of a function are in the form of binary numbers (Boolean values) i.e., the values are either zero (0) or one (1). Therefore, digital logic is also known as 'Boolean logic'. These inputs and output can be termed as 'Boolean Variables'. The output Boolean variable of a digital signal can be expressed in terms o
5 min read
Serial Binary Adder in Digital Logic
Serial binary adder is a combinational logic circuit that performs the addition of two binary numbers in serial form. Serial binary adder performs bit by bit addition. Two shift registers are used to store the binary numbers that are to be added. A single full adder is used to add one pair of bits at a time along with the carry. The carry output fr
2 min read
Non-binary Counter in Digital Logic
A counter is a circuit that counts the number of occurrences of an input. The circuit consists of flip-flops which along with combinational elements are used for generation of control signals. If M = Total number of states, and n = Total number of flip-flop Then, M <= 2n If M = 2n ; Binary counter and M < 2n ; Non-binary counter Block Diagram
2 min read
Logic Synthesis in Digital Electronics
The process of resolving into component parts or analyzing, interpreting, translating, optimizing (rearranging or rewriting to improve efficiency), and mapping RTL (Register Transfer Level) code into a particular and indicated cell library. Programmed production of logic components in a specific digital circuit which may involve various kinds of co
5 min read
Digital Logic and Design - GATE CSE Previous Year Questions
In this article, we are mainly focusing on the Digital Logic & Design GATE Questions that have been asked in Previous Years, with their solutions. And where an explanation is required, we have also provided the reason. Topic-Wise Quizzes to Practice Previous Year's QuestionsLogic functions and MinimizationCombinational CircuitsSequential circui
1 min read
List of “Difference Between” Digital Logic and Design Topics
Digital Logic and Design are the main part of ultramodern electronic systems which enable the structure of complex circuits that power our world of digital and technology. This is a system in computers that uses simple values to produce I/ O operations. These distinctions include sense gates, circuit designs, and design approaches, and They have a
4 min read
What is Digital Logic ?
Modern computing system consists of complex system and technologies. These technologies are built upon some fundamental simple logics known as digital logic. By using digital logic gates we can develop complex logical circuit for various purposes like data storing, data manipulation or simply data representation. What is Digital Logic?One of the mo
2 min read