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

2

1 Answer

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).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy