Summary: An algorithm to implement a boolean function as a gate network using only NAND's or only NOR's is presented. Any boolean function can be implemented straightforwardly using AND's, OR's, and NOT gates. Using DeMorgan's Law in different forms gates in the network can be successively converted to use only NAND's or only NOR's.
NAND's and NOR's are the most common basic logic circuit element in use because they are simpler to build than AND and OR gates, and because each is logically complete . Many logical functions are expressed using AND's, OR's, and Inverters (NOT), however, because an implementing circuit can be constructed straightforwardly from the truth table expression of a logical function and because Karnaugh Map's can be used to minimize AND, OR, INVERTER networks.
This document is adapted, with permission, from algorithms and examples given in Dr. Jump's Elec326 course notes.
Below a simple algorithm is given for converting a network with AND gates, OR gates and INVERTERS to one with NAND gates or NOR gates exclusively. First the boolean function is represented using AND's, OR's, and NOT gates. Then, using DeMorgan's Law in various forms, the AND, OR, INVERTER network is converted step-by-step to use only NAND gates or only NOR gates.
| OR to NAND | AND to NOR |
| |
|
| DeMorgan's Laws Illustrated Using Logic Gates |
|---|
![]() |
| Conversion Example |
|---|
![]() |
Note that in step c. the final elimination of inverters isn't quite done since B and D are inverted into one of the NAND's.
AND, OR, and NOT is a logically complete set. NAND is logically complete. NOR is logically complete.