What is the correct 6-bit 2's complement representation of -32?

  • Thread starter Thread starter TheMathNoob
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 4K views
TheMathNoob
Messages
189
Reaction score
4

Homework Statement


write the 6-bit 2's complement representation of -32

Homework Equations

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.
 
Physics news on Phys.org
TheMathNoob said:

Homework Statement


write the 6-bit 2's complement representation of -32

Homework Equations

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.
You didn't write the Relevant Equations. How does 2s complement work? What is zero? What is +1? What is -1?
 
TheMathNoob said:
write the 6-bit 2's complement representation of -32
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
 
Buzz Bloom said:
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
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.
 
haruspex said:
-32 can be written in 6 bit 2's complement, but +32 cannot.
Hi haruspex:

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

Regards,
Buzz
 
TheMathNoob said:

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.
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.