1. Not finding help here? Sign up for a free 30min 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!

2's complement problem

  1. Feb 13, 2016 #1
    1. The problem statement, all variables and given/known data
    write the 6-bit 2's complement representation of -32

    2. Relevant equations


    3. The attempt at a solution
    the only way to represent the magnitude 32 in binary is by using 6 bits, so it would be 100000. This is a little bit confusing to me hence in 2's complement we always use the most significant bit to indicate negativeness or positiveness. If 100000 is in 2's complement then it should be a negative number and it is if we just apply the math on it. I think that one more bit will be needed but the book says otherwise. 32 in 2's complement in 6 bits is 100000 and -32 in 2's complement 6 bits is 100000.
     
  2. jcsd
  3. Feb 13, 2016 #2

    berkeman

    User Avatar

    Staff: Mentor

    You didn't write the Relevant Equations. How does 2s complement work? What is zero? What is +1? What is -1?
     
  4. Feb 13, 2016 #3

    fresh_42

    Staff: Mentor

    You cannot have both ±32 since this would be 65 numbers and 6 bits are only 64 numbers.
     
  5. Feb 14, 2016 #4
    Hi TheMathNoob:

    Unless the notation of for 6 bit representations of numbers has changed since I learned about them many decades ago, this is a trick question. What is the representation of 64 in 6 bit notation?

    Hope this helps.

    Regards,
    Buzz
     
  6. Feb 14, 2016 #5

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    To my knowledge, it has not changed in 50 years, and it is not a trick question. -32 can be written in 6 bit 2's complement, but +32 cannot.
    One way to think of it is that the nth bit from the right, starting at n=0, represents 2n, with the leftmost being negative and the rest positive.
     
  7. Feb 14, 2016 #6
    Hi haruspex:

    Of course you are right. Sloppy thinking on my part, another senior moment. Thanks for your correction.

    Regards,
    Buzz
     
  8. Feb 18, 2016 #7

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    I wonder if you're misreading what the book says. Does it really say the six-bit, two's complement representation of +32 is 1000002? Or does it say the binary representation of 32 is 1000002, and then proceed to find the two's complement of that?

    If the book says that the two's complement representation of +32 is 1000002, that's incorrect, as others have pointed out.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: 2's complement problem
  1. 2 problems (Replies: 8)

Loading...