-647 in binary (two's complement in a 16-bit representation) is : 1111 1101 0111 1001
(−647)10=(1111 1101 0111 1001)2
To convert the decimal number −647 to binary, we follow these steps:
Convert the absolute value:
First, convert 647 (ignoring the negative sign) to binary.
Divide by 2 and record the remainders:
- 647÷2=323 remainder 1
- 323÷2=161 remainder 1
- 161÷2=80 remainder 1
- 80÷2=40 remainder 0
- 40÷2=20 remainder 0
- 20÷2=10 remainder 0
- 10÷2=5 remainder 0
- 5÷2=2 remainder 1
- 2÷2=1 remainder 0
- 1÷2=0 remainder 1
So, 64710=10100001112.
Account for the negative sign:
- Using two's complement representation for negative numbers, you invert the binary digits and add 1.
Step 1: Invert the bits of 647 (1010000111):
- Inverted: 0101111000
Step 2: Add 1:
- 0101111000+1=0101111001
Step 3: Prepend 1:
- Prepend 1 to get a 16-bit representation : 1111 1101 0111 1001
Thus, −64710 in binary (using two's complement in a 16-bit representation) is 1111 1101 0111 10012.