Computing Library › Classical Logic Gates
Classical Logic Gates

De Morgan's Laws

De Morgan's laws convert between AND and OR through inversion, letting any gate be rebuilt from its dual.

The two laws

De Morgan's laws state that the complement of an AND is the OR of the complements, and the complement of an OR is the AND of the complements:

Kronos motion — classical

Verification by truth table

ABNOT(A AND B)NOT A OR NOT B
0011
0111
1011
1100

The two output columns match on every row, which proves the first law. The second follows the same way.

The bubble-pushing rule

In diagrams the laws appear as bubble pushing: an AND gate with a bubble on its output is identical to an OR gate with bubbles on both inputs, and vice versa. Pushing bubbles through a gate flips its shape between AND and OR.

Why they are indispensable

Generalization

The laws extend to any number of inputs: the complement of a big AND is the OR of all the complemented inputs, and the complement of a big OR is the AND of all of them. This scaling makes De Morgan the most-used identity in gate-level design.