The IT Law Wiki

Binary-coded decimal

Redirected from BCD

32,299pages on
this wiki
Add New Page
Talk0 Share

Definition Edit

Binary-coded decimal is a format for representing decimal numbers (integers) in which each digit is represented by four bits.

Overview Edit

To encode a decimal number using the common BCD encoding, each decimal digit is stored in a 4-bit nibble:

Decimal:    0     1     2     3     4     5     6     7     8     9
BCD:     0000  0001  0010  0011  0100  0101  0110  0111  1000  1001

Thus, the BCD encoding for the number 127 would be:

 0001 0010 0111

Whereas the pure binary number would be:

 0111 1111

Since most computers store data in 8-bit bytes, there are two common ways of storing 4-bit BCD digits in those bytes:

Unlike binary-encoded numbers, BCD-encoded numbers can easily be displayed by mapping each of the nibbles to a different character. Converting a binary-encoded number to decimal for display is much harder, as this generally involves integer multiplication or divide operations. BCD also avoids problems where fractions that can be represented exactly in decimal cannot be represented in binary (e.g., one-tenth).

See also Edit

This page uses Creative Commons Licensed content from Wikipedia (view authors). Smallwikipedialogo.png

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki