0
votes

I'm having trouble converting the following two’s complement binary number to decimal

01110000

Step 1: Invert the bits -> 10001111 Step 2: Add 1 to the bit -> 10010000

Therefore, the decimal value is 144

However, I used online converter and it says the decimal value is 112

1
You are correct that binary 10010000 is 144. The online converter is probably converting that binary into two's complement. Two's complement of 10010000 is binary 01110000 which is 112. Or maybe the online converter is just converting binary into decimal and it converted 01110000 into decimal.alfredo
@alfredo ya probably thanksBob

1 Answers

0
votes

The value of ...111 0111 0000 (padded with an infinite number of 1's) is -144. The value of ...000 0111 0000 (padded with an infinite number of 0's) is 112. Given the former, one could compute its additive inverse by inverting all the bits (yielding ...000 1000 1111) and adding 1 (yielding ...000 1001 0000, i.e. 144).