Decimal to BCD Converter
A decimal-to-BCD (Binary Coded Decimal) converter is a type of code convert that converts a decimal number into its equivalent 4-bit binary code, called BCD code.
The truth table of the decimal to binary-coded decimal (BCD) converter is shown below.
| Decimal | BCD Code | |||
|---|---|---|---|---|
| B3 | B2 | B1 | B0 | |
| 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 |
The Boolean expressions for converting decimal to BCD are given below −
$$\mathrm{B_{0} \: = \: D_{1} \: + \: D_{3} \: + \: D_{5} \: + \: D_{7} \: + \: D_{9}}$$
$$\mathrm{B_{1} \: = \: D_{2} \: + \: D_{3} \: + \: D_{6} \: + \: D_{7}}$$
$$\mathrm{B_{2} \: = \: D_{4} \: + \: D_{5} \: + \: D_{6} \: + \: D_{7}}$$
$$\mathrm{B_{3} \: = \: D_{8} \: + \: D_{9}}$$
The logic circuit implementation of the decimal to BCD converter is shown in the following figure.
This logic circuit can perform the conversion of a given decimal number into a binary-coded decimal or BCD code.