Going from sign/magnitude of a hex value to it's two's complement

  • Thread starter Thread starter leo255
  • Start date Start date
  • Tags Tags
    Value
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
leo255
Messages
57
Reaction score
2

Homework Statement



Hi all!

You are given the hex 9AB. I need to go from sign and magnitude of it, to it's two's complement (in 13-bit).

The Attempt at a Solution



What I did was convert the hex to binary:

0100110101011 <-- I added an extra 0 for the 13th bit

I then flipped the digits, and added "1" and got this:

1011001010101

The answer to this is supposed to be 2475, and I'm not getting that. Would appreciate any help anyone can give.

Thanks.
 
Physics news on Phys.org