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

  • Thread starter leo255
  • Start date
  • #1
57
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.
 

Answers and Replies

  • #3
phinds
Science Advisor
Insights Author
Gold Member
16,900
7,864
Your two's complement is correct.
 

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

Replies
0
Views
15K
  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
1
Views
1K
  • Last Post
Replies
8
Views
1K
  • Last Post
Replies
2
Views
21K
Replies
1
Views
9K
  • Last Post
Replies
1
Views
4K
Replies
2
Views
11K
Replies
1
Views
3K
Top