A NAND gate is an electronic logic gate that is a combination of an AND gate and a NOT gate. In fact, the name NAND is a contraction of NOT and AND. The output of a NAND gate is LOW when both of the inputs are HIGH. Otherwise, the output of the NAND gate is HIGH.

Input A Input B Output
0 0 1
0 1 1
1 0 1
1 1 0

The standard symbol for a NAND gate is the same as the symbol for an AND gate, with the addition of a circle at the output. As in the symbol for a NOT gate, the circle indicates that the output is inverted. In other words, a NAND gate is an AND gate whose output is inverted.

The NAND gate is special because you can use various combinations of NAND gates to create AND, OR, or NOT gates. Thus, a logic network that consists of a combination of NOT, AND, and OR gates can be created with an equivalent combination of just NAND gates. For this reason, the NAND gate is called a universal gate.

Another interesting thing about the NAND gate is that it can be used as a kind of OR gate that tests for LOW inputs instead of HIGH inputs. In other words, the output of a NAND gate is HIGH whenever either of the inputs are LOW.

This characteristic of NAND gates is useful in many situations. For example, a sensor that detects whether a door is open is essentially a simple switch that is closed when the door is closed and open when the door is open. When the door is closed, current flows through the switch so the signal from the sensor is HIGH. When the door is opened, current stops flowing and the signal goes LOW.

NAND gates can be used to test for a LOW input on any of eight sensors.