BCD - Binary Corded Decimal
- Binary Coded Decimal is a numerical code.
- In this code structure, each of the decimal digits (0-9) is represented by a four-bit binary code (eg: 3 is represented by 0011)
- Each digit is then represented by it's binary equivalent.
- 16 unique(different) numbers can be stored in the 4 bit binary code.
- Thus there are 6 invalid four-bit combinations in the BCD code
The number 59 is coded in BCD as follows
5 | 9 |
0101 | 1001 |
BCD code is 01011001
The number 386 is coded in BCD as follows:
3 | 8 | 6 |
0011 | 1000 | 0110 |
BCD code is 001110000110
This makes BCD easy to read, but it is not very efficient in terms of storage space, nor is it as efficiently processed in hardware.
Converting the Decimal value 546 to BCD
5 = 0101
4 = 0100
6 = 0110
4 = 0100
6 = 0110
Thus 54610 = 0101010001102
Converting the binary value 011100010101 to decimal is
0111 = 7
0001 = 1
0101 = 5
0001 = 1
0101 = 5
Thus 0111000101012 = 71510