A 2 n {\displaystyle 2^{n}} -to-n encoder has n number of outputs in correspondence to the 2 n {\displaystyle 2^{n}} number of inputs. It thus reduces the number of transmission lines and can be compared to a multiplexer. Only one of the inputs become "high" (logic state "1") at a time.
For example, a 4-to-2 simple encoder takes 4 input bits and produces 2 output 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 high bits) the outputs are treated as don't cares.1
https://en.m.wikipedia.org/wiki/Encoder_(digital)#/editor/4 https://en.m.wikipedia.org/wiki/Encoder_(digital)#/editor/4
"Binary Encoders And Their Applications". Electronics Hub. 2015-06-29. Retrieved 2017-05-01. http://www.electronicshub.org/binary-encoder/ ↩