This section contains 265 words (approx. 1 page at 300 words per page) |
BCD (binary coded decimal) is a system for converting ordinary decimal digits (the numbers 0-9) into 4-bit binary numbers. In BCD, each digit of a decimal number is coded separately as a 4-bit word (sometimes called a "nibble," since 8-bit words are called "bytes"). For ease of reading, these 4-bit groups are often displayed separated by spaces. The BCD format is founded on the binary number system, which is based on powers of 2; that is, the weights of the four bit positions in BCD, from right to left, are 20 = 1, 21 = 2, 22 = 4, and 23 = 8. BCD format is thus also denoted "8-4-2-1."
The BCD code is as follows: 0000 = 0, 0001 = 1, 0010 = 2, 0011 = 3, 0100 = 4, 0101 = 5, 0110 = 6, 0111 = 7, 1000 = 8, and 1001 = 9. The decimal number 271, for instance, is represented as 0010 0111 0001 in BCD. Note that the words 1010-1111 are unassigned, and that each BCD nibble encodes, by definition, for a single positive digit. This is because BCD is not a scheme for encoding numbers in general, but for encoding digits, which are the component symbols of larger numbers.
BCD is primarily used for encoding decimal numbers so that they can be transmitted within and between certain computing devices. The 4 bits of a BCD digit code may, for instance, be passed through a code converter to control a 7-segment digit display device of the type that hand calculators use to display individual digits. The fact that BCD only uses 10 of the 16 available 4-bit words is a form of built-in inefficiency; therefore, the numbers processed in a computer's arithmetic-logic unit are represented in more efficient formats such as two's-complement (for integers) or floating-point, not in BCD.
This section contains 265 words (approx. 1 page at 300 words per page) |