Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have the 2's complement, negative number 1111 1111 1011 0101 (0xFFBB5). How can I represent this as a decimal number in base 10?

share|cite|improve this question
up vote 4 down vote accepted

If $x$ is an $n$ digit number written in two's complement, then $\tilde{} x +1 = -x$, where $\tilde{} x$ is the $n$-digit not of $x$. In your case, ~0xFFBB5 + 1 = 0x0044B = 1099, so your number is $-1099$.

share|cite|improve this answer

Here is the process to convert a negative two's complement number back to decimal:

(1) flip all the bits,

(2) add 1, and

(3) interpret the result as a binary representation of the magnitude and add a negative sign

So, for your example, we have:

$$1111~1111~1011~0101 \xrightarrow{(1)} 0000~0000~0100~1010 \xrightarrow{(2)} 0000~0000~0100~1011 \xrightarrow{(3)} -75$$

It looks like you wrote the wrong binary and meant:

$$1111~1111~1011~1011~0101 \xrightarrow{(1)} 0000~0000~0100~0100~1010 \xrightarrow{(2)} 0000~0000~0100~0100~1011 \xrightarrow{(3)} -1099$$

Of course, in Hex, you can invert all the bits and add 1 and take a negative magnitude.


share|cite|improve this answer
Great outline of strategy, and followed by applying it (perfect combination) +1 – amWhy May 7 '13 at 0:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.