Binary-coded decimal: Difference between revisions

Content deleted Content added
m restore missing line(s) and add packed BCD sign information
GRAHAMUK (talk | contribs)
BCD in electronics
Line 2:
[[de:BCD]]
 
'''Binary coded decimal''' (BCD) is a [[numeral system]] used in computer memory and [[electronics]] systems. In BCD, numbers are represented as decimal digits, and each digit is represented by four [[bit]]s:
 
Digit Bits Digit Bits
Line 15:
 
While BCD is wasteful (about 1/6 of the available memory is wasted, even in packed BCD), it has a direct correspondence to the [[ASCII]] character set if the BCD number is prepended or OR'd with 00110000 (decimal 48), and large numbers can easily be displayed on 7-element displays by splitting up the [[Integral data type|nybbles]] and sending each to a different character (the individual characters often have the wiring to display the correct figures). The [[BIOS]] in PCs usually keeps the date and time in BCD format, probably for historical reasons (it avoided the need for binary to ASCII conversion).
 
==BCD in electronics==
 
BCD is very common in electronic systems where a numeric value is to be displayed, especially in systems consisting solely of [[digital]] [[logic]], and not containing a [[microprocessor]]. By utilising BCD, the manipulation of numerical data for display can be greatly simplified by treating each digit as a separate single sub-circuit. This matches much more closely the physical reality of display hardware - a designer might choose to use a series of separate, but identical [[7-segment display]]s to build a metering circuit, for example. If the numeric quantity were stored and manipulated as pure binary, interfacing to such a display would require complex circuitry. By working throughout with BCD, a much simpler overall system results.