Skip to content
Tactiverge

Digital logic

De Morgan's laws

Also called: De Morgan · break the bar, change the sign · negating and/or

Definition

NOT (A AND B) equals (NOT A) OR (NOT B), and NOT (A OR B) equals (NOT A) AND (NOT B).

Picture it

Negating a combined condition flips every part and swaps AND with OR. 'Not (raining and cold)' means 'not raining or not cold'. Programmers use it to tidy if statements, and designers use it to swap gate types.

The maths

NOT(A · B) = Ā + B̄
NOT(A + B) = Ā · B̄
SI units used in this entry
QuantityUnitSymbol
ratiodimensionless1

Worked example

Simplify the stop condition not (speed_ok and temp_ok). For how many of the four input combinations is it true?

  1. not (a and b) = (not a) or (not b)
  2. False only when both are true: 1 of 4 rows
  3. True in 4 − 1 = 3 rows

Answer(not speed_ok) or (not temp_ok): true in 3 of the 4 cases.

✓ The number in this answer is recomputed from scratch by an automated test.

logic tester

Logic gate tester

Y = 1

Y = A ⊕ B

Truth table for XOR; the current row is marked.
ABY
000
011
101 ◀ now
110
XOR with A = 1, B = 0 gives Y = 1.

Ideal gates: no propagation delay. 1 = true = high, 0 = false = low.

Common misconceptions

  • Misconception: NOT (A AND B) is not (NOT A) AND (NOT B): you must swap the operator as well.
  • Misconception: The laws extend to any number of inputs.