- Reference: Kumar
- Wikipedia is ok too
- Binary Coded Decimal
- Used in early computer systems.
- IE they did not use binary.

- It is a way to represent decimal numbers in an easy to use binary format.
- Wikipedia says it is still used in some financial systems.
- A round-off error in decimal is something we can "deal" with legally and socially.
- A round-off error in binary is more complex socially.

- Idea: Use 4 bits to represent each digit, encoded in binary, to encode a decimal number.
- 0100 1000 0111
_{BCD}= 487 - 3873 = 0011 1000 0111 0010
_{BCD}

- 0100 1000 0111
- We only use the digits 0-9 and corresponding binary codes.
- This means we "waste" 1010 through 1111 or 6 representations per digit.

- Mathematical operations in BCD are possible
- But initially the sum may be one of the unrepresentable characters.
- So we add 6 to the result.
- Example 5+7
0101

_{2}+0111_{2}----- 1100_{2} - But 1100
_{2}is not a legal BCD digit, so add 61100

_{2}+0110_{2}---- 10010_{2}Which is 2 with a carry - Why 6? This skips the 6 unused digits.

- So addition of BCD involves ripply carry with detection of "bad representations"
- i.e. we add three to each digit.
- 0 is represented as 0011
- 1 is represented as 0100
- ... 9 is 1100
- 0000, 0001, 0010 and 1101, 1110, 1111 are not used.
- If a carry occurs, then we just add three to find the result

- So 5 + 7 becomes
1000

_{BCD-3}+ 1010_{BCD-3}------ 10010_{BCD-3?} - so the carry is 1, but the sum (0010) is not a legal value
- So we add three (0101
_{BCD-3}) -
0010

_{2}+0011_{2}----- 0101_{BCD-3}

- You can tell me what BCD means.
- You can tell me it was used in old computer systems.
- You can represent numbers in BCD
- You can give the decimal equivalent for numbers in BCD