What is Binary Coded Decimal (BCD)?

 --> (Word) --> (PDF) --> (Text)

Problem:

What is Binary Coded Decimal (BCD)?

Solution:

Binary Coded Decimal (BCD) is a method of encoding numbers where each decimal digit is encoded separately. Using this code scheme, your computer is able to manipulate numbers to the base ten (decimal) instead of to the base two (binary). BCD manipulation preserves accuracy by reducing round-off errors.

[tweet]

The BCD encoding is performed by using a four-digit binary number to encode each digit of the base ten number. Computations are then performed using the encoded digits.

The astute student will see that this is a lot like converting from binary to hexadecimal. In this case though there are no letters like A through F which is part of making it easier to read. In a pure binary sense the 16-bit word can have a value of 0 to 65535 but BCD limits us from 0 to 9999.

The following table shows the BCD representation of the decimal numbers 0 through 9:

Using the table above we can convert the decimal 542 into the equivalent in BCD, which is 010101000010.