BINARY CODED DECIMAL
This is another code like ASCII or Gray. The advantage of BCD is the ease of converting to and from decimal. BCD is often used whenever decimal information is needed at an output. Examples are electronic calculators, digital clocks, digital voltmeters and frequency counters. The disadvantage is that it cannot be used in mathematical calculations.
|
DECIMAL DIGIT |
BCD |
|
0 |
0000 |
|
1 |
0001 |
|
2 |
0010 |
|
3 |
0011 |
|
4 |
0100 |
|
5 |
0101 |
|
6 |
0110 |
|
7 |
0111 |
|
8 |
1000 |
|
9 |
1001 |
The Binary numbers for 10 to 15 are not used and so the codings 1010 to 1111 are not valid. These are sometimes called "forbidden". If they appear in a machine using BCD an error wil have occurred.
Example
Convert the following numbers to BCD
30610 0011 0000 0110
Exercise
71410
09510
10110
Example
Convert the following BCD numbers to DECIMAL
0010 0101 1001 259
Exercise
1000 0111 0000
0110 1011 0100
0001 0000 0010