1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Two's compliment of SIGNED binary

  1. Jan 3, 2013 #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 thats it! Does anyone know what to do?
     
  2. jcsd
  3. Jan 3, 2013 #2

    I like Serena

    User Avatar
    Homework Helper

    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)
     
  4. Jan 3, 2013 #3
    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?
     
  5. Jan 3, 2013 #4

    I like Serena

    User Avatar
    Homework Helper

    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?
     
  6. Jan 4, 2013 #5
    It could be sign-magnitude representation.
     
  7. Jan 4, 2013 #6

    I like Serena

    User Avatar
    Homework Helper

    That's what I said or what I at least intended:
    "a representation with a separate sign bit (used for floating point)"
     
  8. Jan 4, 2013 #7
    Thanks for all of your help! You are right. He just looked at a different question when he was writing the problem I think.
     
  9. Jan 4, 2013 #8
    Thanks
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Two's compliment of SIGNED binary
Loading...