Skip to main content

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.

A+B‾=Aˉ⋅Bˉ\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.

A⋅B‾=Aˉ+Bˉ\overline{A \cdot B} = \bar{A} + \bar{B}

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

Proof by truth table

ABA+B‾\overline{A+B}Aˉ⋅Bˉ\bar A \cdot \bar BAB‾\overline{AB}Aˉ+Bˉ\bar A + \bar B
001111
010011
100011
110000

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 111147 = 32 + 8 + 4 + 2 + 1 = 0010\ 1111
  • 27=16+8+2+1=0001 101127 = 16 + 8 + 2 + 1 = 0001\ 1011

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: −47+27=−20-47 + 27 = -20.

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

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 2 questions →