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

-62 in binary (2's complement on 16 bits) is: 1100 0010

(62)10=(1100 0010)2(-62)_{10}=(1100~0010)_2


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

1. absolute value conversion (62)

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

  • 62÷2=3162 \div 2 = 31, remainder 0
  • 31÷2=1531 \div 2 = 15, remainder 1
  • 15÷2=715 \div 2 = 7, remainder 1
  • 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 6262 is :

(62)10=(111110)2(-62)_ {10} = (111110)_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 144062 (111110)

  • Inverted: 000001

Step 2 : Add 1

  • 000001 + 1 = 000010

Step 3 : Complete with 1s

  • Add 1's to obtain a 8-bit representation: 1100 0010

On 8 bits, this gives :

(62)10=(1100 0010)2(-62)_{10}=(1100~0010)_2