user
What is the conversion of -647 from decimal to binary base?
alphonsio

-647 in binary (two's complement in a 16-bit representation) is : 1111 1101 0111 1001
(647)10=(1111 1101 0111 1001)2(-647)_{10} = (1111~1101~0111~1001)_{2}


To convert the decimal number 647-647 to binary, we follow these steps:

  1. Convert the absolute value:

    • First, convert 647647 (ignoring the negative sign) to binary.

    • Divide by 2 and record the remainders:

      • 647÷2=323647 \div 2 = 323 remainder 11
      • 323÷2=161323 \div 2 = 161 remainder 11
      • 161÷2=80161 \div 2 = 80 remainder 11
      • 80÷2=4080 \div 2 = 40 remainder 00
      • 40÷2=2040 \div 2 = 20 remainder 00
      • 20÷2=1020 \div 2 = 10 remainder 00
      • 10÷2=510 \div 2 = 5 remainder 00
      • 5÷2=25 \div 2 = 2 remainder 11
      • 2÷2=12 \div 2 = 1 remainder 00
      • 1÷2=01 \div 2 = 0 remainder 11

      So, 64710=10100001112647_{10} = 1010000111_2.

  2. Account for the negative sign:

    • Using two's complement representation for negative numbers, you invert the binary digits and add 11.

    Step 1: Invert the bits of 647647 (1010000111):

    • Inverted: 01011110000101111000

    Step 2: Add 1:

    • 0101111000+1=01011110010101111000 + 1 = 0101111001

    Step 3: Prepend 1:

    • Prepend 1 to get a 16-bit representation : 1111 1101 0111 10011111~1101~0111~1001

Thus, 64710-647_{10} in binary (using two's complement in a 16-bit representation) is 1111 1101 0111 100121111~1101~0111~1001_2.