Fundamental Digital Electronics/Digital Encoder
Digital Encoder is a Digital Device opposite of the Digital Decoder . A simple encoder circuit can receive a single active input out of 2n input lines generate a binary code on n parallel output lines.
For example a single bit 4 to 2 encoder takes in 4 bits and outputs 2 bits. The illustrated gate level example implements the simple encoder defined by the truth table, but it MUST be understood that for all the non-explicitly defined input combinations (i.e. inputs containing 0, 2, 3, or 4 bits) the outputs are treated as don't cares. Thus this implementation is useless as a priority encoder and only useful as a simple encoder if some previous circuit guarantees that there is one and only one bit high in the input or if it is understood that non-single-active-inputs will produce garbage encodings.