##### Encoder | Non Priority Encoder | Priority Encoder

Encoder:
It is a combinational circuit that performs inverse operation of decoder.It performs lossless compression.
An encoder has 2N or fewer input lines and N output lines.
These are of two types :
1. Non priority encoder - These encoders do not support simultaneous input activation.
For example, consider 8x3 encoder circuit as below:

Truth table for 8X3 encoder:

 D0 D1 D2 D3 D4 D5 D6 D7 X Y Z 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1

2. Priority encoder- These encoders support simultaneous input activation and used for interrupt servicing.
The operation of priority encoder is such that if two or more than two inputs are equal to 1 at the same time then, the input having the highest priority will take precedence.
For example, consider the truth table of a 4x2 priority encoder

 D0 D1 D2 D3 X Y ∅ ∅ ∅ 1 1 1 ∅ ∅ 1 0 1 0 ∅ 1 0 0 0 1 1 0 0 0 0 0

X = D3+D2
Y = D3+D2'D1