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
SUMMARY

The discussion revolves around converting the hexadecimal value 9AB to its two's complement representation in 13 bits. The user initially converted 9AB to binary as 0100110101011, added an extra bit for the 13th position, and then performed the two's complement operation by flipping the digits and adding one. The correct two's complement result is 1011001010101, which corresponds to the decimal value 2475. The confusion arose from the interpretation of the hexadecimal value rather than the conversion process itself.

PREREQUISITES
  • Understanding of hexadecimal and binary number systems
  • Knowledge of two's complement representation
  • Familiarity with bit manipulation techniques
  • Basic arithmetic operations in binary
NEXT STEPS
  • Study the process of converting hexadecimal to binary
  • Learn about two's complement and its applications in computer systems
  • Explore binary arithmetic operations, including addition and subtraction
  • Practice converting various hexadecimal values to their two's complement forms
USEFUL FOR

This discussion is beneficial for computer science students, software developers, and anyone interested in understanding binary arithmetic and number representation in computing.

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