An encoder has 2n or fewer input lines, only one of which is in the “1” state at a particular time and an n-bit code is generated on “n” output lines depending upon which of the input is excited. In other words, an encoder is a circuit in which output lines generate the binary code corresponding to the input value.
Octal To Binary Encoder
An octal to binary encoder has 23 = 8 input lines D0 to D7 and 3 output lines Y0 to Y2. Below is the truth table for an octal to binary encoder.
Y0 = D1 + D3 + D5 + D7
Y1 = D2 + D3 + D6 + D7
Y2 = D4 + D5 + D6 + D7
Note: Above boolean functions are formed by ORing all the input lines for which output is 1. For instance Y0 is 1 for D1, D3, D5, D7 input lines.
The encoder can therefore be implemented with OR gates whose inputs are determined directly from truth table as shown in the image below:
Rectangular Diode Matrix For Octal To Binary Encoder
- For 8 bits input, there can be 28 possible combinations, out of which only 8 are used using 3 output lines.
- In the octal to binary encoder, an output with all 0’s is generated when all the inputs are zero. This output is same as when D0 is equal to 1. The discrepancy can be resolved by providing one additional line known as Enable.
When Enable = 0, an output with all 0’s is generated when all the inputs are zero.
When Enable = 1, an output with all 0’s is generated when D0 is equal to one.
Thus, Enable line helps to ensure whether D0 is activated or not when output is zero.
- The octal to binary encoder has one more limitation that only one input can be active at any given time. If two inputs are active simultaneously, the output produces an undefined combination. For example, if D3 and D6 are 1 simultaneously, the output of the encoder will be 111 (Y2 =Y1=Y0 = 1). This does not represent either binary 3 or binary 6. To resolve this problem, encoder circuits must establish an input priority to ensure that only one input is encoded.
If we establish a higher priority for inputs with higher subscript number and if both D3 and D6 are 1 at the same time, the output will be 110 because D6 has higher priority than D3.