In computing and electronic systems, binary-coded decimal (BCD) is a class of binary encodings of decimal numbers where each digit is represented by a fixed number of bits, usually four or eight. Sometimes, special bit patterns are used for a sign or other indications (e.g. error or overflow).
In byte-oriented systems (i.e. most modern computers), the term unpacked BCD[1] usually implies a full byte for each digit (often including a sign), whereas packed BCD typically encodes two digits within a single byte by taking advantage of the fact that four bits are enough to represent the range 0 to 9. The precise four-bit encoding, however, may vary for technical reasons (e.g. Excess-3).
The ten states representing a BCD digit are sometimes called tetrades[2][3] (the nibble typically needed to hold them is also known as a tetrade) while the unused, don't care-states are named pseudo-tetrad(e)s ,[4][5][6][7][8] pseudo-decimals[3] or pseudo-decimal digits.[9][10][nb 1]
BCD's main virtue, in comparison to binary positional systems, is its more accurate representation and rounding of decimal quantities, as well as its ease of conversion into conventional human-readable representations. Its principal drawbacks are a slight increase in the complexity of the circuits needed to implement basic arithmetic as well as slightly less dense storage.
BCD was used in many early decimal computers, and is implemented in the instruction set of machines such as the IBM System/360 series and its descendants, Digital Equipment Corporation's VAX, the Burroughs B1700, and the Motorola 68000-series processors.
BCD per se is not as widely used as in the past, and is unavailable or limited in newer instruction sets (e.g., ARM; x86 in long mode). However, decimal fixed-point and decimal floating-point formats are still important and continue to be used in financial, commercial, and industrial computing, where the subtle conversion and fractional rounding errors that are inherent in binary floating point formats cannot be tolerated.[11]
Intel_IA32
was invoked but never defined (see the help page).Klar_1970
was invoked but never defined (see the help page).Klar_1989
was invoked but never defined (see the help page).Schneider_1986
was invoked but never defined (see the help page).Tafel_1971
was invoked but never defined (see the help page).Steinbuch-Weber-Heinemann_1974
was invoked but never defined (see the help page).Tietze-Schenk_2013
was invoked but never defined (see the help page).Kowalski_1070
was invoked but never defined (see the help page).Ferretti_2013
was invoked but never defined (see the help page).Speiser_1965
was invoked but never defined (see the help page).Cowlishaw_GDA
was invoked but never defined (see the help page).
Cite error: There are <ref group=nb>
tags on this page, but the references will not show without a {{reflist|group=nb}}
template (see the help page).