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
Click For Summary
The discussion revolves around converting the hex value 9AB to its two's complement in 13 bits. The initial conversion to binary resulted in 0100110101011, with an extra bit added for the 13th position. After flipping the digits and adding one, the resulting binary was 1011001010101. The confusion arises from the decimal value of 9AB, which is confirmed to be 2475. The final two's complement conversion is deemed correct, resolving the original query.
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
Your two's complement is correct.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
Replies
3
Views
5K
  • · Replies 2 ·
Replies
2
Views
13K
  • · Replies 6 ·
Replies
6
Views
10K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K