HOME

TheInfoList



OR:

An encoder (or "simple encoder") in
digital electronics Digital electronics is a field of electronics involving the study of digital signals and the engineering of devices that use or produce them. It deals with the relationship between Binary number, binary inputs and outputs by passing electrical s ...
is a
one-hot In digital circuits and machine learning, a one-hot is a group of bits among which the legal combinations of values are only those with a single high (1) bit and all the others low (0). A similar implementation in which all bits are '1' except ...
to binary converter. That is, if there are 2''n'' input lines, and at most only one of them will ever be high, the binary code of this 'hot' line is produced on the ''n''-bit output lines. A binary encoder is the dual of a
binary decoder In digital electronics, a binary decoder is a combinational logic circuit that converts binary information from the n coded inputs to a maximum of 2n unique outputs. They are used in a wide variety of applications, including instruction decoding ...
. If the input circuit can guarantee at most a single-active input, a simple encoder is a better choice than a
priority encoder A priority encoder is a Electronic circuit, circuit or algorithm that compresses multiple Binary code, binary inputs into a smaller number of outputs, similar to a Encoder (digital), simple encoder. The output of a priority encoder is the binary re ...
, since it requires less logic to implement. However, a simple encoder can generate an incorrect output when more than a single input is active, so a
priority encoder A priority encoder is a Electronic circuit, circuit or algorithm that compresses multiple Binary code, binary inputs into a smaller number of outputs, similar to a Encoder (digital), simple encoder. The output of a priority encoder is the binary re ...
is required in such cases.


Types of encoder


2n-to-n encoders

A 2^n-to-n encoder has n number of outputs in correspondence to the 2^n number of inputs. It thus reduces the number of transmission lines and can be compared to a
multiplexer In electronics, a multiplexer (or mux; spelled sometimes as multiplexor), also known as a data selector, is a device that selects between several Analog signal, analog or Digital signal (electronics), digital input signals and forwards the sel ...
. 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.


4-to-2 encoder

https://en.m.wikipedia.org/wiki/Encoder_(digital)#/editor/4 https://en.m.wikipedia.org/wiki/Encoder_(digital)#/editor/4


See also

*
Binary decoder In digital electronics, a binary decoder is a combinational logic circuit that converts binary information from the n coded inputs to a maximum of 2n unique outputs. They are used in a wide variety of applications, including instruction decoding ...
*
Multiplexer In electronics, a multiplexer (or mux; spelled sometimes as multiplexor), also known as a data selector, is a device that selects between several Analog signal, analog or Digital signal (electronics), digital input signals and forwards the sel ...
(MUX) *
Priority encoder A priority encoder is a Electronic circuit, circuit or algorithm that compresses multiple Binary code, binary inputs into a smaller number of outputs, similar to a Encoder (digital), simple encoder. The output of a priority encoder is the binary re ...


References

{{Reflist Digital electronics