Two's compliment of SIGNED binary

  • Thread starter Thread starter fractal01
  • Start date Start date
  • Tags Tags
    Binary
AI Thread Summary
The discussion centers on understanding the two's complement method for signed binary numbers. Participants clarify that the two's complement involves inverting the bits and adding one, which applies to signed numbers as well. An example is provided, demonstrating that the two's complement of 1 (0001) results in -1 (1111). The conversation also touches on alternative representations like sign-magnitude and 1's complement, noting that these are less common. Ultimately, the confusion seems to stem from a miscommunication regarding a lecturer's example, which may have involved a different representation method.
fractal01
Messages
13
Reaction score
1
The twos compliment for regular binary numbers- you just replace all 1's by 0's and 0's by 1's and then +1. So how would you go about finding out for signed...I have got as far as changing the first digit then that's it! Does anyone know what to do?
 
Physics news on Phys.org
Hi fractal01! :smile:

"Signed" is the same thing (at least in 2's complement, which is pretty standard).

Suppose you take the number 1.
The binary representation is: 0001
The 2's complement is 1110+1=1111.
This is the same as the representation for -1.

Suppose you add them:
0001 + 1111 = (1)0000.

Yes! It is zero! (disregarding the carry over)
 
I like Serena said:
Hi fractal01! :smile:

"Signed" is the same thing (at least in 2's complement, which is pretty standard).Yes! It is zero! (disregarding the carry over)

Hey! Thank you so much! My lecturer gave us some questions and in one of the answers he came up with something completely different and it was the only example so I have been struggling over it for at least half an hour! Everyone is human I guess and makes mistakes...but are you sure that this is the only way of calculating this?
 
fractal01 said:
...but are you sure that this is the only way of calculating this?

This is the way the 2's complement representation and its associated "signed" works.

There are other representations, such as 1's complement (unusual), and a representation with a separate sign bit (used for floating point), but those are not "regular" binary numbers.

So what did your lecturer come up with?
 
It could be sign-magnitude representation.
 
aralbrec said:
It could be sign-magnitude representation.

That's what I said or what I at least intended:
"a representation with a separate sign bit (used for floating point)"
 
I like Serena said:
That's what I said or what I at least intended:
"a representation with a separate sign bit (used for floating point)"

Thanks for all of your help! You are right. He just looked at a different question when he was writing the problem I think.
 
aralbrec said:
It could be sign-magnitude representation.
Thanks
 
Back
Top