Updated 2016-01-14 08:10:22 by pooryorick

Binary Coded Decimal is a way of representing integer numbers in a computer. Each decimal digit is stored in 4 bits, so one byte (8 bits or an octet) contains two decimal digits.

The mapping is simply:
  decimal   BCD
  --------------
    0       0000
    1       0001
    2       0010
    3       0011
    4       0100
    5       0101
    6       0110
    7       0111
    8       1000
    9       1001

The decimal number 45 translates to BCD 01000101, which is just the concatenation of 0100 and 0101.

Also used as the name of a number of character sets (mostly six bits wide) that preceded EBCDIC as the internal representation of alphanumeric Hollerith cards. Generally speaking, the most significant two bits referred to the 'zone' punches 12, 11, and 0, while the least significant two bits referred to the 'numeric' punches 1-9. escargo Wouldn't that be least significant

four bits?
   See http://www.cwi.nl/~dik/english/codes/80col.html for a discussion.

See Also  edit

Comp3 data conversion
convert BCD to a string