Give a correct and full answer to question how convert

tebollahb

tebollahb

Answered question

2021-12-17

Give a correct and full answer to question how convert 2's complement to decimal?

Answer & Explanation

scomparve5j

scomparve5j

Beginner2021-12-18Added 38 answers

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?
Paul Mitchell

Paul Mitchell

Beginner2021-12-19Added 40 answers

If x is an n digit number written in two's complement, then x+1=x,where x is the n-digit binary NOT of x.
In your case, 0xFFBB5+1=0x0044B=1099, so your number is −1099.
Jeffrey Jordon

Jeffrey Jordon

Expert2021-12-26Added 2605 answers

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:
11111111101101011000000000100101020000000001001011375
It looks like you wrote the wrong binary and meant:
1111111110111011010110000000001000100101020000000001000100101131099
Of course, in Hex, you can invert all the bits and add 1 and take a negative magnitude.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?