---
title: "De Morgan's theorem and (-47+27) by 2's complement"
subject: "Digital Logic"
chapter: 2
key: "semester_3/digital_logic:demorgan-twos-complement-addition"
source: https://www.bctengineer.com/q/semester_3/digital_logic/demorgan-twos-complement-addition
site: BCT Engineering
---

# De Morgan's theorem and (-47+27) by 2's complement

Digital Logic · Chapter 2: Digital Logic

- Asked in: 2076 Chaitra, 3+3 marks
- Video: [De Morgan's Law in Boolean Algebra Explained (with Solved Examples)](https://www.youtube.com/watch?v=W7YTfLaPWRY) — ALL ABOUT ELECTRONICS
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/digital_logic/demorgan-twos-complement-addition
- Whole chapter: https://www.bctengineer.com/md/semester_3/digital_logic/chapter-2

## Question

State and prove the De-Morgan's theorem and perform the addition (-47+27) by using 2's complement method.

## Short answer

De Morgan's laws: ¬(A+B)=¬A·¬B, ¬(A·B)=¬A+¬B, proved by truth table. For (-47)+27 using 8-bit 2's complement: -47 is 11010001, +27 is 00011011, sum is 11101100 (no carry), which is -20 in decimal.

## Answer

#### De Morgan's theorems
**First theorem:** the complement of a sum (OR) of variables equals the product (AND) of their complements.
$$
\overline{A + B} = \bar{A} \cdot \bar{B}
$$

**Second theorem:** the complement of a product (AND) of variables equals the sum (OR) of their complements.
$$
\overline{A \cdot B} = \bar{A} + \bar{B}
$$

In words: "break the bar and change the sign".

**Proof by truth table**

| A | B | $\overline{A+B}$ | $\bar A \cdot \bar B$ | $\overline{AB}$ | $\bar A + \bar B$ |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 |

For all four input combinations, column 3 equals column 4 and column 5 equals column 6, so both theorems are proved.

#### (−47) + (27) using 2's complement
Use 8-bit signed numbers (range −128 to +127).

**Step 1: +47 and +27 in binary**
- $47 = 32 + 8 + 4 + 2 + 1 = 0010\ 1111$
- $27 = 16 + 8 + 2 + 1 = 0001\ 1011$

**Step 2: 2's complement of 47 (to get −47)**

```text
 +47            = 0010 1111
 1's complement = 1101 0000
 add 1          = 1101 0001  (= -47)
```

**Step 3: Add**

```text
   -47  =  1101 0001
 + +27  =  0001 1011
 -------------------
           1110 1100
```

No carry out of the MSB, and the sign bit is 1, so the result is negative and is in 2's complement form.

**Step 4: Find its magnitude** (take 2's complement)

```text
 result         = 1110 1100
 1's complement = 0001 0011
 add 1          = 0001 0100  = 20
```

Check: $-47 + 27 = -20$.

**Answer:** $(-47) + (27) = (1110\ 1100)_2$ in 2's complement $= -20_{10}$

## Check yourself

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

1. (A+B+C)' =
   A. A'B'C'
   B. A'+B'+C'
   C. ABC
   D. A+B+C
   Answer: A. Extends to any number of variables. (Key point: Theorem)

2. How is -47 formed?
   A. Invert bits of +47 and add 1
   B. Invert only
   C. Add 1 only
   D. Subtract 1
   Answer: A. 47 = 00101111 gives 11010001. (Key point: 2's complement)

3. 8-bit sum of -47 and +27?
   A. 00010100
   B. 11010001
   C. 10101100
   D. 11101100
   Answer: D. 11010001 + 00011011. (Key point: Sum)

4. Sign bit 1 and no carry means?
   A. Positive 20
   B. Overflow
   C. Negative result in 2's complement; magnitude 20
   D. Result is 236
   Answer: C. 2's complement of 11101100 is 00010100 = 20, so -20. (Key point: Interpretation)

## Related in Digital Logic

- [Prove De Morgan's theorems; XOR using NAND](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Ademorgan-prove-xor-nand) — Digital Logic, chapter 2, asked 3×
- [State and prove De Morgan's laws](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Ademorgan-state-prove) — Digital Logic, chapter 2, asked 2×
- [De Morgan; X-NOR using a universal gate](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Ademorgan-xnor-universal-gate) — Digital Logic, chapter 2
- [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
- [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
- [39 to binary/hex and 2's complement addition](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aconvert-39-binary-hex-addition) — Digital Logic, chapter 1

## Related in other subjects

- [State and prove De Morgan's theorems](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Ade-morgan-state-prove) — Basic Electronics Engineering, chapter 6, asked 4×
- [De Morgan's theorem and duality theorem](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Ade-morgan-duality) — Basic Electronics Engineering, chapter 6
- [Merge sort on 47, 27, 56, 23, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Amerge-sort-trace-47-27) — Data Structure and Algorithm, chapter 7
- [State and prove Green's theorem](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Astate-and-prove-greens-theorem) — Mathematics III, chapter 2, asked 11×
