Integers: BCD | |||||||||||||
Since people think in decimal, it may be convenient to use a decimal-like representation. | |||||||||||||
Binary coded decimal (BCD) uses unsigned binary to represent each decimal digit. | |||||||||||||
How many bits are needed? | |||||||||||||
4 bits per decimal digit: ceil (lg 10) = 4 | |||||||||||||
Since 4 bits can represent 16 values, 6 values are unused for every digit. | |||||||||||||