I am a new rookie in computer engineering, not sure how to get the 2's complement representation of -32 in 6-bits, because -32 is reaching limit.
how to find 6-bit 2’s complement representation of -32
3.5k views Asked by Bill L. At
1
I am a new rookie in computer engineering, not sure how to get the 2's complement representation of -32 in 6-bits, because -32 is reaching limit.
For 2's complement, the easiest method is this one:
Example: -7. 7 is
000111
. The first 1 is on the right, keep it then inverse the rest. You get111001
.So in your example, you can't represent -32 with six bits, since the first one is also the last one. Si it will be read
100000
=>-011111
=> 31.You need at least one more bite to avoid overflow (the last bite on the left being the "sign": 0 for positive, 1 for negative).