Skip to main content

39 to binary/hex and 2's complement addition

Short answer

39 decimal is 100111 binary and 27 hexadecimal. For -28+17 in 8-bit 2's complement: -28 = 1110 0100, +17 = 0001 0001; sum = 1111 0101 (no carry), representing -11 in decimal.

Convert decimal 39 into binary and hexadecimal. Use 2's complement method to perform the following addition (-28+17).

Decimal 39 to binary

DivisionQuotientRemainder
39 ÷ 2191
19 ÷ 291
9 ÷ 241
4 ÷ 220
2 ÷ 210
1 ÷ 201

Answer: (39)10=(100111)2(39)_{10} = (100111)_2

Decimal 39 to hexadecimal

39 ÷ 16 = 2 remainder 7, and 2 ÷ 16 = 0 remainder 2. (Check: group binary 0010 0111 → 2 7.)

Answer: (39)10=(27)16(39)_{10} = (27)_{16}

(−28) + 17 using 2's complement (8 bits)

  • +28=0001 1100+28 = 0001\ 1100
  • 1's complement: 1110 00111110\ 0011; add 1 → −28=1110 0100-28 = 1110\ 0100
  • +17=0001 0001+17 = 0001\ 0001
    1110 0100   (-28)
  + 0001 0001   (+17)
  -----------
    1111 0101   no end carry

No end carry and MSB = 1, so the answer is negative in 2's complement form. Its magnitude is the 2's complement: 0000 1010+1=0000 1011=110000\ 1010 + 1 = 0000\ 1011 = 11.

Answer: 1111 01012=(−11)101111\ 0101_2 = (-11)_{10}

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 1 questions →