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

-898 in binary (2's complement on 16 bits) is: 1111 1100 0111 1110

(898)10=(1111 1100 0111 1110)2(-898)_{10}=(1111~1100~0111~1110)_2


To convert the number -898 from decimal to binary, we first convert the positive number 898 to binary, then encode the negative sign (2's complement).

1. absolute value conversion (898)

Let's divide 898898 by 22 and note the remainder at each step:

  • 898÷2=449898 \div 2 = 449, remainder 0
  • 449÷2=224449 \div 2 = 224, remainder 1
  • 224÷2=112224 \div 2 = 112, remainder 0
  • 112÷2=56112 \div 2 = 56, remainder 0
  • 56÷2=2856 \div 2 = 28, remainder 0
  • 28÷2=1428 \div 2 = 14, remainder 0
  • 14÷2=714 \div 2 = 7, remainder 0
  • 7÷2=37 \div 2 = 3, remainder 1
  • 3÷2=13 \div 2 = 1, remainder 1
  • 1÷2=01 \div 2 = 0, remainder 1

Reading the remainders from bottom to top, the binary conversion of 898898 is :

(898)10=(1110000010)2(-898)_ {10} = (1110000010)_2

2. Negative sign

The negative sign is represented by the 2's complement. Invert each bit and add 1 to the result:

Step 1: invert the bits of 1440898 (1110000010)

  • Inverted: 0001111101

Step 2 : Add 1

  • 0001111101 + 1 = 0001111110

Step 3 : Complete with 1s

  • Add 1's to obtain a 16-bit representation: 1111 1100 0111 1110

On 16 bits, this gives :

(898)10=(1111 1100 0111 1110)2(-898)_{10}=(1111~1100~0111~1110)_2