- 2076 Chaitra · 3+3 marks
De Morgan's theorem and (-47+27) by 2's complement
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.
State and prove the De-Morgan's theorem and perform the addition (-47+27) by using 2's complement method.
De Morgan's theorems
First theorem: the complement of a sum (OR) of variables equals the product (AND) of their complements.
Second theorem: the complement of a product (AND) of variables equals the sum (OR) of their complements.
In words: "break the bar and change the sign".
Proof by truth table
| A | 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
Step 2: 2's complement of 47 (to get −47)
+47 = 0010 1111
1's complement = 1101 0000
add 1 = 1101 0001 (= -47)
Step 3: Add
-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)
result = 1110 1100
1's complement = 0001 0011
add 1 = 0001 0100 = 20
Check: .
Answer: in 2's complement
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Prove De Morgan's theorems; XOR using NAND · Digital Logic, chapter 2 · asked 3×
- State and prove De Morgan's laws · Digital Logic, chapter 2 · asked 2×
- De Morgan; X-NOR using a universal gate · Digital Logic, chapter 2
- 39 to Gray/Excess-3 and 2's complement addition · Digital Logic, chapter 1
- Gray→BCD, decimal→Excess-3 and 2's complement addition · Digital Logic, chapter 1
- 39 to binary/hex and 2's complement addition · Digital Logic, chapter 1
- State and prove De Morgan's theorems · Basic Electronics Engineering, chapter 6 · asked 4×
- De Morgan's theorem and duality theorem · Basic Electronics Engineering, chapter 6
- Merge sort on 47, 27, 56, 23, ... · Data Structure and Algorithm, chapter 7
- State and prove Green's theorem · Mathematics III, chapter 2 · asked 11×