NAND Gate – Logic Gates Tutorial

A NAND gate is a logic gate where the output goes LOW (or “0”) only if all its inputs are HIGH (or “1”). The schematic symbol for a NAND gate is like the AND gate, just with a circle at the output to indicate that it’s an inverted version of AND.

NAND truth table and symbol

“NAND” stands for NOT-AND because it’s the same as an AND gate with a NOT gate on the output.

NAND equivalent by using AND and NOT gates
NAND gate equivalent using AND and NOT gates

The logic or Boolean expression for a NAND gate is \overline{A.B} = Q which means that:

If A or B is false, then Q is true

Truth Table

NAND gates can have more than two inputs. But no matter how many inputs it has, it will only give out a LOW or logic “0” if all its inputs are HIGH. As soon as one of the inputs goes LOW, the output goes HIGH.

2-input NAND Gate Truth Table

NAND gate symbol
Input AInput BOutput Q
001
011
101
110

3-input NAND Gate Truth Table

3-input NAND gate symbol
Input AInput BInput COutput Q
0001
0011
0101
0111
1001
1011
1101
1110

Build a Transistor NAND Gate with RTL

You can build a NAND gate from transistors and resistors. This technique is called resistor-transistor logic (RTL).

RTL version of the NAND gate
NAND gate with transistors and resistors

To get a LOW output, both transistors must be turned on. Otherwise, the output will be pulled HIGH through the top resistor. That means both A and B must be HIGH for the output to become LOW.

Although you could build it with transistors and resistors, it’s not really practical. You’ll need a lot of components just to make a simple logic gate. Luckily, there are many ICs that you can use out-of-the-box.

IC Alternatives with NAND Gates

Pinout for the 4011 IC

If you want to experiment and build circuits with NAND gates, you’ll find them in both the 4000 IC series and the 7400 IC series:

  • 4011: Four 2-input NAND gates
  • 4023: Three 3-input NAND gates
  • 4093: Four 2-input NAND gates (Schmitt trigger inputs)
  • 4572: One NAND gate (plus a few other gates)
  • 40107: Two 2-input NAND gates
  • 74HC00: Four 2-input NAND gates (HC is the family, can also be LS/HCT/…)
  • 74HC01: Four 2-input NAND gates (HC is the family, can also be LS/HCT/…)
  • 74HC03: Four 2-input NAND gates (HC is the family, can also be LS/HCT/…)
  • 74HC10: Three 3-input NAND (HC is the family, can also be LS/HCT/…)
  • 74HC11: Three 3-input NAND (HC is the family, can also be LS/HCT/…)

These should all be available as hobbyist-friendly through-hole chips. Just make sure you buy the DIP package version.

NAND Example Circuit: SR Latch

A typical circuit you can build with two NAND gates is an SR latch. It will remember the last output value it had, so it’s a simple form of memory.

In the following circuit, you can turn the Light-Emitting Diode (LED) on by touching the On pad. The LED will stay on even after you release the button. To turn the LED off, you can press the Off pad.

The touch pads are just two pieces of metal that are not touching each other. They should be placed close enough so that your finger touches them both when pressing.

Touch switch circuit schematic

More Logic Gates Tutorials

Leave a Comment