Also known as BCD. This is a way of using four bits to count to 10.
Zero is 0.
- 0001
- 0010
- 0011
- 0100
- 0101
- 0110
- 0111
- 1000
- 1001
This is
inefficient, of course, but it is useful in a couple of areas:
- Making drivers for 7 segment LED displays. Instead of using one byte for each digit on the display, you can stick two BCD numbers in each byte, and halve your required space.
- Accounting software. If you want to be accurate to the penny, then you need to work in the same base system as the currency. Calculating 1/5 in binary will leave you with a repeating fraction, which does not happen in the decimal system. Calculating 1/16 in binary will leave you with a number that does not get rounded, which does happen in the decimal system.