The Decimal-to-BCD Encoder
Recall that with BCD the ten decimal digits (0,1,…,9) are represented by their four-digit binary counterparts. Consequently, we expect the Decimal-to-BCD encoder to have 10 inputs and 4 outputs. The logic symbol for this 10-line-to-4-line decoder is presented in Figure 2-11 and the associated conversion table listed in Table 2-13 with A3 representing the most significant bit.
Figure 2-11 Logic symbol for Decimal-to-BCD Encoder
Decimal Digit | BCD Code | |||
A3 | A2 | A1 | A0 | |
0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 1 |
2 | 0 | 0 | 1 | 0 |
3 | 0 | 0 | 1 | 1 |
4 | 0 | 1 | 0 | 0 |
5 | 0 | 1 | 0 | 1 |
6 | 0 | 1 | 1 | 0 |
7 | 0 | 1 | 1 | 1 |
8 | 1 | 0 | 0 | 0 |
9 | 1 | 0 | 0 | 1 |
Table 2-13 Decimal-to-BCD code table
Now, note that the MSB is defined by the function
A3 = 8 + 9
Similarly, A2, A1 and A0 are defined by the functions
A2 = 4 + 5 + 6 + 7
A1 = 2 + 3 + 6 + 7
A0 = 1 + 3 + 5 + 7 + 9
Now we can implement the logic circuit for the decimal-to-BCD-decoder as illustrated in Figure 2-12.
Figure 2-12 Logic circuit for Decimal-to-BCD encoder