BINARY CODED DECIMAL

From WikiEducator
Jump to: navigation, search

Binary Coded Decimal

Binary-coded decimal, or BCD, is a method of using binary digits to represent the decimal digits 0 through 9. A decimal digit is represented by four binary digits, as shown below:

NF130188.gif

You should note in the table above that the BCD coding is the binary equivalent of the decimal digit.

Since many devices use BCD, knowing how to handle this system is important. You must realize that BCD and binary are not the same. For example, 49 in binary is 110001, but 49 in BCD is 01001001. Each decimal digit is converted to its binary equivalent.

BCD Conversion

You can see by the above table, conversion of decimal to BCD or BCD to decimal is similar to the conversion of hexadecimal to binary and vice versa.

For example, let's go through the conversion of [math]264_{10}[/math] to BCD. We'll use the block format that you used in earlier conversions. First, write out the decimal number to be converted; then, below each digit write the BCD equivalent of that digit:

2 = 0010
6 = 0110
4 = 0100

The BCD equivalent of 264 is 001001100100.

To convert from BCD to decimal, simply reverse the process as shown:

1001 = 9
1000 = 8
0011 = 3

Reference

Binary Coded Decimal