Binary-coded decimal

From ScienceZero
Jump to: navigation, search

Binary-coded decimal is an encoding of decimal numbers where each digit is encoded by a fixed number of bits. The most common is to use 4 bits per digit but any number larger than 3 is possible.

In binary-coded decimal 1103 may be encoded as 0001 0001 0000 0011.
In binary it would be encoded as the more compact 100 0100 1111.

BCD makes it easy to manipulate isolated digits of a number but it makes most math operations cumbersome and slow. The exception is dividing and multiplying with 10n.