user3247712
user3247712

Reputation: 47

How to solve this using 2's compliment?

-19 - 25

I got -19 being 1101101 and -25 = 1100110

I know the answer is -44 which is 1010100 in binary but I can't figure out how to get it using the -19 -25.

Upvotes: 0

Views: 445

Answers (1)

kai
kai

Reputation: 6887

Your -25 should be 1100111 instead of 1100110. Than you can solve it with an logical &:

-19: 1101101 -> 19: 0010011 
-25: 1100111 -> 25: 0011001
-44: 1010100 -> 44: 0101100

Upvotes: 1

Related Questions