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

-184 in binary (2's complement on 16 bits) is: 1111 1111 0100 1000

(184)10=(1111 1111 0100 1000)2(-184)_{10}=(1111~1111~0100~1000)_2


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

1. absolute value conversion (184)

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

  • 184÷2=92184 \div 2 = 92, remainder 0
  • 92÷2=4692 \div 2 = 46, remainder 0
  • 46÷2=2346 \div 2 = 23, remainder 0
  • 23÷2=1123 \div 2 = 11, remainder 1
  • 11÷2=511 \div 2 = 5, remainder 1
  • 5÷2=25 \div 2 = 2, remainder 1
  • 2÷2=12 \div 2 = 1, remainder 0
  • 1÷2=01 \div 2 = 0, remainder 1

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

(184)10=(10111000)2(-184)_ {10} = (10111000)_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 1440184 (10111000)

  • Inverted: 01000111

Step 2 : Add 1

  • 01000111 + 1 = 01001000

Step 3 : Complete with 1s

  • Add 1's to obtain a 16-bit representation: 1111 1111 0100 1000

On 16 bits, this gives :

(184)10=(1111 1111 0100 1000)2(-184)_{10}=(1111~1111~0100~1000)_2