Priority Encoder Tutorial: Limitation of Encoders, Working, Design and Applications
Limitation of Basic Encoders
- Conventional encoders operate correctly only when one input line is active (HIGH) at a time. The encoder assumes that all other input lines remain inactive (LOW).
Problem of Multiple Active Inputs
- In real practical systems, it is possible that two or more inputs become HIGH simultaneously. This situation may occur unintentionally due to user actions or system conditions.
Example of Simultaneous Inputs
- Consider a keyboard system where a user presses key 3 before releasing key 4. In this situation, both input lines corresponding to 3 and 4 become HIGH at the same time.
Incorrect Output in Basic Encoders
- When multiple inputs are HIGH in a simple encoder, the output becomes ambiguous or incorrect. Instead of producing the correct code for either input, the encoder may generate an invalid output.
Need for Priority Encoder
To solve the problem of multiple simultaneous inputs, a priority encoder is used. It ensures that only one input is considered at a time based on a predefined priority rule.
Definition of Priority Encoder
A priority encoder is a digital logic circuit that encodes the input with the highest priority among all active inputs, ignoring the lower-priority ones.
Applications of Priority Encoder
Few applications of priority encoder are listed below:
- Interrupt Handling in Microprocessors: selects the highest-priority interrupt request and sends it to the processor for immediate servicing.
- Keyboard Encoding: detect and encode the key with the highest priority.
- Bus Arbitration in Computer Systems: determine which device gets access to the bus first based on its priority level.
- Interrupt Priority Management in Embedded Systems: A priority encoder ensures that critical tasks by timers, communication modules, and sensors are serviced before less important ones.
Design a 4-bit Priority Encoder
- In a 4-bit priority encoder, there are four input lines (D₀, D₁, D₂, and D₃) and typically two output lines that produce the binary code of the highest-priority active input, along with an optional valid output (V) that indicates the presence of at least one active input.
- The priority is generally determined by the input index, where the input with the highest subscript has the highest priority. Such encoders are widely used in interrupt handling, data selection, and bus arbitration in digital and computer systems.
Truth Table Representation
- The operation of a 4-input priority encoder is represented by its truth table, which specifies the relationship between the four inputs (D₀, D₁, D₂, D₃) and the outputs (A, B, V).

Fig 1: Truth table of 4-input priority encoder
The circuit has three outputs:
- A and B – represent the binary code of the highest-priority active input.
- V (Valid bit) – indicates whether a valid input is present.
The output V is set to 1 whenever one or more input lines are HIGH (1). This indicates that the encoder has a valid input to encode.
- A and B – represent the binary code of the highest-priority active input.
- V (Valid bit) – indicates whether a valid input is present.
- The output V is set to 1 whenever one or more input lines are HIGH (1). This indicates that the encoder has a valid input to encode.
Condition When All Inputs Are Zero
If all inputs (D₀, D₁, D₂, D₃) are 0, then there is no valid input. In this case:
- V = 0
- Outputs A and B are not significant and are treated as don’t care conditions.
Priority Assignment
- In the priority encoder, priority is determined by the subscript of the inputs.
- The higher the subscript number, the higher the priority.
Highest Priority Input
- Input D₃ has the highest priority.
- If D₃ = 1, the output AB = 11 (binary representation of 3), regardless of the states of other inputs.
Second Priority Level
- Input D₂ has the next priority.
- If D₂ = 1 and D₃ = 0, then the output AB = 10 (binary 2), regardless of the values of the lower-priority inputs D₁ and D₀.
Lower Priority Inputs
- Input D₁ produces an output only when higher-priority inputs (D₃ and D₂) are 0.
- Similarly, D₀ is considered only when all higher-priority inputs are 0.
Condition for Valid Output (V)
The valid bit V is obtained by performing the OR operation of all input variables:
V=D0+D1+D2+D3
From the truth table, we can find out the min-term for the output A and B.
A = ∑m (1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15)
B = ∑m (1, 3, 4, 5, 7, 9, 11, 12, 13, 15)
Figure 2 (a) and 2 (b) shows the corresponding K-map for the output function A and B to obtain the minimized expression for logic diagram.

Fig. 2 (a): K-map for output A

Fig. 2 (b): K-map for output B
Figure 3 shows the logic expression for the 4-input priority encoder.

Fig. 3: Logic diagram of 4-input priority encoder
FAQs
What is a priority encoder?
A priority encoder is a combinational logic circuit that converts multiple input signals into a binary output while giving priority to the highest-order input when more than one input is active.
Why is a priority encoder needed instead of a simple encoder?
A simple encoder works correctly only when one input is active at a time. A priority encoder is used when multiple inputs may be active simultaneously, ensuring that the highest-priority input is encoded.
What is the role of the valid output (V) in a priority encoder?
The valid output (V) indicates whether at least one input is active. If all inputs are LOW, V = 0; otherwise, V = 1.
What happens if multiple inputs are HIGH simultaneously?
The encoder selects the input with the highest priority and produces the corresponding binary output while ignoring the lower-priority inputs.
What are the applications of priority encoders?
Priority encoders are used in interrupt handling in microprocessors, keyboard encoding, bus arbitration, communication systems, and digital control systems.
What is arbitration in priority encoders?
Arbitration is the process of selecting one input among multiple competing inputs based on priority.
What is the difference between an encoder and a priority encoder?
An encoder assumes only one input is active at a time, whereas a priority encoder can handle multiple active inputs and selects the highest-priority one.
