BCD adder: 25 + 48 with the +6 correction — adders
edge casewhen binary addition is not decimal addition
Answer
01110011 = 73
Why this example is worth doing
Adding packed BCD in a binary adder produces a wrong digit whenever the result exceeds nine, because binary rolls over at sixteen and decimal at ten. Adding six re-aligns it and generates the decimal carry. The page shows the detection condition and the corrected digit, and hands off to the BCD converter for the representation. It is the clearest case on the site of a representation forcing a change in the arithmetic hardware.
Try your own input in the Half adder & full adder. Truth tables, K-maps and circuits for both adders, and the ripple-carry chain.
How the answer is reached
BCD addition 00100101 + 01001000
Work least significant digit first. Add the two digits and the carry in. If the raw sum exceeds 9 OR the 4-bit add carried out, add 0110 and carry 1 into the next digit.
| digit | raw sum | 5-bit | > 9? | nibble carry | correction | digit | carry out |
|---|---|---|---|---|---|---|---|
| 1 | 2 + 4 + 1 = 7 | 00111 | no | 0 | - | 0111 (7) | 0 |
| 0 | 5 + 8 + 0 = 13 | 01101 | yes | 0 | +0110 | 0011 (3) | 1 |
result0111 001173
why 616 - 10 = 6— BCD skips the six codes 1010..1111, so a binary carry (weight 16) has to be realigned with a decimal carry (weight 10)
Correction applied at digit 0 (counting from the least significant digit).