Most negative number (in octal and hex) of a 16-bit one's complement system?

7.4k Views Asked by At

In a 16-bit one's complement system, how do you represent the most negative number in octal and hex?

One's complement: http://en.wikipedia.org/wiki/Ones'_complement

The most negative 16-bit number in the one's complement system is -32767. In hex, this number is: 8001. However, converting the one's complement binary representation of -32767 (1000 0000 0000 0000) to hex gives 8000. What gives?

NOTE: Since computers cannot store negative signs, I am omitting them. Hence, F7A is -134 in base 10 and not 3962.

2

There are 2 best solutions below

8
On

In ones complement notation, you are correct that the most negative number that fits in $16$ bits is $-32767_{10}$ If you convert this to signed octal you get $-077777_8$ or in hex it is $-7FFF_{16}$. If you convert it to ones complement, you get $100000_8$ or $ 8000_{16}$ In a sixteen bit octal word, the lower five digits (octits?) represent three bits each, while the leading one is a single bit to make sixteen. What do you think is wrong about $8000_{16}$? You said it was octal, but it is hex, and a fine hex number at that.

3
On

The number $32768$ has a binary representation $1000\ 0000\ 0000\ 0000$ and a hex representation $8000$.

The point of one's complement is that because the string $1000\ 0000\ 0000\ 0000$ has a $1$ at its first coordinate, it does not mean the positive integer but the negative integer whose binary representation is $-111\ 1111\ 1111\ 1111$. That number is $-32767$, or $-7FFF$ in hex.