0

To solve this I took the 10s complement of 43, which is 57. Then I tried to add the BCD values of 57 and 198 like this:

enter image description here

The right answer is 155 but I got 255. Pretty sure the carry is the problem. I'm not sure what to do with the carry. I've seen in examples that it is discarded but those examples were only for 1 digit operands. When I did that with larger digit operands it was missing the carry. Maybe I am supposed to discard it only with the leftmost operands?

Help

8
  • How is this a programming question?
    – Ken White
    Commented Dec 1, 2019 at 4:00
  • @KenWhite Where should I post this? Commented Dec 1, 2019 at 4:01
  • 2
    "10s complement of 43, which is 57" - it isn't, since you're dealing with 3-digit numbers.
    – user555045
    Commented Dec 1, 2019 at 4:10
  • I can't tell you that, I'm afraid. All I can tell you is that if it doesn't involve programming (code) or use of a programmers tool (IDE, compiler, etc.), it's not appropriate here.
    – Ken White
    Commented Dec 1, 2019 at 4:15
  • 1
    @harold is right (and his comment should be an Answer) if you use 3 digit arithmetics then the complement must be 3 digit too ... 1000-43 = 957 so 957+198 = 1|155 which is correct
    – Spektre
    Commented Dec 1, 2019 at 9:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.