---
title: "39 to binary/hex and 2's complement addition"
subject: "Digital Logic"
chapter: 1
key: "semester_3/digital_logic:convert-39-binary-hex-addition"
source: https://www.bctengineer.com/q/semester_3/digital_logic/convert-39-binary-hex-addition
site: BCT Engineering
---

# 39 to binary/hex and 2's complement addition

Digital Logic · Chapter 1: Introduction

- Asked in: 2074 Asoj, 2+3 marks
- Video: [Binary Subtraction | 1's | 2's | Complement | Digital logic design | Digital Electronics | STLD | CO](https://www.youtube.com/watch?v=TCGuxRbXU2Q) — Sudhakar Atchala
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/digital_logic/convert-39-binary-hex-addition
- Whole chapter: https://www.bctengineer.com/md/semester_3/digital_logic/chapter-1

## Question

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

## 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.

## Answer

#### Decimal 39 to binary
| Division | Quotient | Remainder |
|---|---|---|
| 39 ÷ 2 | 19 | 1 |
| 19 ÷ 2 | 9 | 1 |
| 9 ÷ 2 | 4 | 1 |
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |

**Answer: $(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}$**

#### (−28) + 17 using 2's complement (8 bits)
- $+28 = 0001\ 1100$
- 1's complement: $1110\ 0011$; add 1 → $-28 = 1110\ 0100$
- $+17 = 0001\ 0001$

```text
    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 = 11$.

**Answer: $1111\ 0101_2 = (-11)_{10}$**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is 39 decimal in binary?
   A. 100111
   B. 110011
   C. 101011
   D. 100101
   Answer: A. 39 = 32 + 4 + 2 + 1. (Key point: Binary)

2. What is 39 decimal in hexadecimal?
   A. 39
   B. 27
   C. 93
   D. 2F
   Answer: B. 39 = 2 x 16 + 7. (Key point: Hex)

3. What is -28 in 8-bit 2's complement?
   A. 1110 0011
   B. 1001 1100
   C. 1110 0100
   D. 0001 1100
   Answer: C. Invert 0001 1100 to 1110 0011 and add 1. (Key point: -28 in 2's complement)

4. -28 + 17 = 1111 0101 with no end carry. What does this mean?
   A. The result is positive 11
   B. Overflow occurred
   C. The result is -245
   D. The result is negative; magnitude 11, so -11
   Answer: D. MSB 1 and no carry mean a negative 2's complement result. (Key point: Result sign)

## Related in Digital Logic

- [39 to Gray/Excess-3 and 2's complement addition](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-39-gray-excess3-addition) — Digital Logic, chapter 1
- [Convert octal 623.77 to decimal, binary, hex](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-octal-623-77) — Digital Logic, chapter 1
- [Gray→BCD, decimal→Excess-3 and 2's complement addition](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Agray-bcd-excess3-twos-addition) — Digital Logic, chapter 1
- [Convert 37.432 decimal to binary](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-37-432-binary) — Digital Logic, chapter 1
- [Signed 1's complement addition of (-65)+(+15)](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aones-complement-addition-8bit) — Digital Logic, chapter 5
- [Convert (39.75)₁₀ to octal](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-39-75-octal) — Digital Logic, chapter 1

## Related in other subjects

- [Decimal to binary conversion](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Adecimal-to-binary) — Computer Programming, chapter 5
- [Binary to decimal in FORTRAN](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Afortran-binary-to-decimal) — Computer Programming, chapter 11
- [FSM for binary serial addition](https://www.bctengineer.com/question.md?key=semester_4%2Fdiscrete_structure%3Afsm-binary-serial-addition) — Discrete Structure, chapter 2
