BCD addition rule: Evaluate the BCD sum of 0101 (5) and 0100 (4). Is the result 0000 1001 (i.e., 00001001 BCD)?
-
ACorrect
-
BIncorrect
-
CCorrect only after adding 0110
-
DNeeds decimal adjust and carry
-
EAmbiguous without nibble boundaries
Answer
Correct Answer: Correct
Explanation
Introduction / Context:Binary-coded decimal (BCD) encodes each decimal digit in a 4-bit nibble. We add 5 (0101) and 4 (0100) and verify the BCD correction rules and final encoding.
Given Data / Assumptions:
- Operands are single-digit BCD values: 0101 and 0100.
- We use standard BCD correction (add 0110 when a nibble exceeds 1001).
- We present the result in 8-bit form as 0000 1001 for a one-digit sum.
Concept / Approach:First perform binary addition of the low nibble. If the nibble sum is greater than 1001 (9) or a carry is generated, add 0110 to correct to valid BCD. Here, 0101 + 0100 = 1001 (9), which is already a valid BCD digit; no correction is needed.
Step-by-Step Solution:
Compute binary nibble sum: 0101 + 0100 = 1001.Check validity: 1001 ≤ 1001 and no nibble carry → valid BCD.Place result in 8-bit BCD: upper nibble 0000, lower nibble 1001 → 0000 1001.Verification / Alternative check:Decimal check: 5 + 4 = 9 → BCD 1001; extended to 8 bits as 0000 1001.
Why Other Options Are Wrong:
Incorrect / needs adjust: No adjust is needed because the nibble is ≤ 9.Correct only after adding 0110: Adding 0110 would corrupt a valid digit.Ambiguous without nibbles: Problem explicitly uses single-digit BCD.Common Pitfalls:Applying BCD correction even when the nibble is already valid.
Final Answer:Correct