9. De Morgan's laws

The laws of Augustus De Morgan or simply the De Morgan laws are two transformation rules that allow exchanging AND gates and OR gates simply by negating or inverting the inputs and outputs:

Transformación de OR con entradas negadas en NAND.

OR transformation with negated inputs in NAND.

Transformación de AND con entradas negadas en NOR.

Transformation of AND with negated inputs into NOR.

In the form of a logical formula the expressions would be:

\overline{A} + \overline{B} = \overline{A \cdot B }

\overline{A} \cdot \overline{B} = \overline{A + B }

Another way of expressing De Morgan's laws is:

  • An OR gate with all its inputs and outputs inverted or negated is equivalent to an AND gate.

    Transformación de una puerta OR toda negada a puerta AND.

    Transformation of an all-negated OR gate to an AND gate.

    \overline{ \overline{A} + \overline{B} } = A \cdot B

  • An AND gate with all its inputs and outputs inverted or negated is equivalent to an OR gate.

    Transformación de una puerta AND toda negada a puerta OR.

    Transformation of an all-negated AND gate to an OR gate.

    \overline{ \overline{A} \cdot \overline{B} } = A + B

Double negation

We must remember from the section dedicated to the NOT gate, that a double negation cancels out, resulting in a line without negation:

Una doble negación se cancela entre sí.

A double negation cancels each other.

Knowing De Morgan's laws and this last law, we can always exchange any OR gate for an AND gate and vice versa, regardless of the inputs and outputs it has denied.

Simulation

In the following simulation we can see the operation of De Morgan's laws in several circuits.

As the input values ​​to the following logic gates change, the top gate always outputs the same value as the bottom gate, proving that they are equivalent.

Exercises

  1. Check in the previous simulation that the upper door has the same output as the lower door in each of the 4 circuits that appear.
  2. Transform the following logic gates to use the alternative gate according to De Morgan's laws.
Ejercicio de transformación de puertas lógicas.
Ejercicio de transformación de puertas lógicas.