Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Binary-coded decimal
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|System of digitally encoding numbers}} {{redirect|BCD code|BCD character sets|BCD (character encoding)||}} {{Use dmy dates|date=May 2019|cs1-dates=y}} {{Use list-defined references|date=January 2022}} {{anchor|Compressed}}<!-- parked anchor for redirects --> [[File:Binary clock.svg|250px|thumbnail|right|A [[binary clock]] might use [[Light-emitting diode|LED]]s to express binary values. In this clock, each column of LEDs shows a binary-coded decimal numeral of the traditional [[sexagesimal]] time.]] In [[computing]] and [[electronics|electronic]] systems, '''binary-coded decimal''' ('''BCD''') is a class of [[Binary number|binary]] encodings of [[decimal]] numbers where each [[numerical digit|digit]] is represented by a fixed number of [[bit]]s, usually four or eight. Sometimes, special bit patterns are used for a [[Sign (mathematics)|sign]] or other indications (e.g. error or overflow). In [[byte]]-oriented systems (i.e. most modern computers), the term ''unpacked'' BCD<ref name="Intel_IA32"/> 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]]). {{anchor|Pseudo-tetrade}}The ten states representing a BCD digit are sometimes called ''[[tetrade (computing)|tetrade]]s''<ref name="Klar_1970"/><ref name="Klar_1989"/> (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''{{small|{{bracket|[[:de:Pseudotetrade|de]]}}}},<ref name="Schneider_1986"/><ref name="Tafel_1971"/><ref name="Steinbuch-Weber-Heinemann_1974"/><ref name="Tietze-Schenk_2013"/><ref name="Kowalski_1070"/> ''pseudo-decimals'',<ref name="Klar_1989"/> or ''pseudo-decimal digits''.<ref name="Ferretti_2013"/><ref name="Speiser_1965"/><ref group="nb" name="Pseudo-tetrades"/> BCD's main virtue, in comparison to binary [[positional system]]s, is its more accurate representation and rounding of decimal quantities, as well as its ease of conversion into conventional<!-- many among us can read hexidecimal just fine, though we don't ordinarily memorize the hexadecimal times table --> 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 computer]]s, 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 architecture family|ARM]]; [[x86]] in [[long mode]]). However, decimal [[Fixed-point arithmetic|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 [[round-off error|rounding errors]] that are inherent in binary floating point formats cannot be tolerated.<ref name="Cowlishaw_GDA" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)