A decoder has M inputs and up to 2M outputs. If the logic values on the M inputs are interpreted as a binary number of value P, then the Pth output will be at logic 1 while all the others are at logic 0. The I/O for a decoder is shown in the following figure.
The truth table for a 2-to-4 decoder is shown in the following table.
Input0 | Input1 | Output0 | Output1 | Output2 | Output3 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 |
Decoders can perform more complicated functions. For example, an LED decoder accepts a 4-bit binary number and outputs seven signals that will display the corresponding numeral on a 7-segment LED digit such as the one in the following figure.
The following table shows the truth table for an LED decoder for the digits 0 through 9 (a logic 1 on an output indicates that the corresponding LED segment is lit).
D3 | D2 | D1 | D0 | S6 | S5 | S4 | S3 | S2 | S1 | S0 | Numeral | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 3 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 5 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 6 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 7 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 8 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 9 |
Construction of more complex decoders is shown in the next page.
Last modified 1/1/2000 by Juan de Lara ( Juan.Lara@ii.uam.es, http://www.ii.uam.es/~jlara) need help for using this courses?.