NAND Gate: Truth Table, Symbol, Boolean Expression and Uses

Almost every digital device you own, from your phone to your car’s computer, is built from tiny switches that make simple yes-or-no decisions. One of the most important of those decisions is the NAND gate. It looks like a small thing, but with enough NAND gates you can build every other kind of logic circuit.

A NAND gate, short for “NOT AND,” is a logic gate that gives a LOW output (0) only when all of its inputs are HIGH (1). For every other input combination, the output is HIGH. In other words, it does the exact opposite of an AND gate. Wikipedia describes it as a gate whose output is false only if all of its inputs are true.

This guide explains the NAND gate’s symbol, Boolean expression and truth table, and how it works inside a circuit. You’ll also see why it’s called a universal gate, how to build other gates from it, which chips contain it, and where it shows up in memory circuits and flash storage.

What Is a NAND Gate?

A NAND gate is a digital logic gate that combines an AND operation with a NOT operation. Electronics Tutorials explains it as an AND gate followed by an inverter. The AND part checks whether every input is HIGH. The NOT part flips the answer, so the output is LOW when all inputs are HIGH and HIGH in every other case.

Digital circuits use two voltage levels. HIGH, written as 1, is a higher voltage, and LOW, written as 0, is a lower one. A NAND gate reads these levels at its inputs and sets its output to one of them. It has no memory by itself, which means the output depends only on the inputs at that moment.

The most common version has two inputs, but a NAND gate can have three, four, eight or more inputs. The rule stays the same for all of them. The output is LOW only when every single input is HIGH. If even one input is LOW, the output goes HIGH.

What Is the NAND Gate Symbol and Boolean Expression?

The usual symbol is the shape of an AND gate with a small circle, called a bubble, at the output. The bubble means inversion. Wikipedia lists three symbol styles: the MIL/ANSI symbol, which is the AND shape with a bubble, the IEC symbol, which is a rectangle, and an older DIN symbol that’s deprecated but still shows up on old schematics.

In Boolean algebra, a NAND gate with inputs A and B is written as Y = NOT(A AND B), or Y = (A · B)′, with a bar over the product in many textbooks. Wikipedia writes it as ¬(A∧B). For more inputs, the same idea applies: the output is NOT of all the inputs ANDed together. Another way to write NAND is the Sheffer stroke, written A | B or A ↑ B. Electronics Tutorials notes that this operation isn’t associative, so the order of grouping matters.

De Morgan’s law gives an equivalent form. A NAND B equals (NOT A) OR (NOT B). That means a two-input NAND behaves the same as two inverters feeding an OR gate. Wikipedia points out this equivalence too. It’s useful for simplifying circuits and for converting between gate types.

What Is the NAND Gate Truth Table?

A truth table lists every input combination and the output it produces. A two-input NAND gate has four combinations, because two inputs can each be 0 or 1.

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

Only the last row, with both inputs HIGH, gives a LOW output. A three-input NAND follows the same rule. Its output Q equals NOT(A · B · C), so it’s 0 only when A, B and C are all 1, and it’s 1 in the other seven combinations. In general, an n-input NAND has 2 to the power n rows, and exactly one of them produces a 0.

How Does a NAND Gate Work Inside?

The simplest way to picture it is with two switches in series and a pull-up resistor. Wikipedia describes this model: if either switch is open, the output is pulled HIGH through the resistor. If both switches are closed, the output is connected to ground and goes LOW. That matches the truth table exactly.

Real gates use transistors as the switches. Electronics Tutorials shows a bipolar version with two NPN transistors in series and a pull-up resistor to the positive supply. The output is pulled LOW only when both transistors conduct, which happens only when both inputs are HIGH. If either input is LOW, that transistor turns off, the chain breaks, and the resistor pulls the output HIGH.

Modern chips use CMOS, which pairs two kinds of transistors. According to Wikipedia and its logic page, a two-input CMOS NAND gate uses four transistors: two n-type (nMOS) and two p-type (pMOS). The nMOS transistors sit in series between the output and ground, and the pMOS transistors sit in parallel between the output and the supply. When both inputs are HIGH, both nMOS transistors conduct and pull the output LOW. In every other case at least one pMOS transistor conducts and pulls it HIGH. Because only one path is on at a time, a CMOS gate uses very little power when it isn’t switching.

Why Is the NAND Gate Called a Universal Gate?

A universal gate is one that can build every other logic function. NAND is universal because you can make NOT, AND and OR from it, and those three can build any digital circuit. Electronics Tutorials calls this functional completeness, and Wikipedia says an entire processor could be built from NAND gates alone. NOR gates have the same property.

The idea goes back more than a century. Wikipedia’s NAND logic page says Henry M. Sheffer published the proof in 1913 in the Transactions of the American Mathematical Society. That’s why the NAND operation is also called the Sheffer stroke. Being universal means a factory can mass-produce one simple gate, and designers can combine copies to make anything else.

This also makes NAND popular in teaching. Courses such as “From NAND to Tetris” show students how to build a full computer starting from only NAND gates. It’s a clean way to see how simple switches turn into logic, arithmetic and memory.

How Do You Build Other Gates From NAND Gates?

Each basic gate has a short recipe, based on Wikipedia’s NAND logic page. The gate counts below are the standard minimums for the simplest designs.

Gate you want How to build it with NANDs NAND gates needed
NOT Tie both inputs of one NAND together 1
AND NAND the inputs, then invert the result with a second NAND 2
OR Invert each input with a NAND, then NAND the two results 3
NOR Build an OR, then invert it 4
XOR The four-gate arrangement below 4
XNOR An XOR followed by an inverter 5

The NOT trick works because NAND(A, A) is the same as NOT A. If A is 1, then 1 NAND 1 is 0. If A is 0, then 0 NAND 0 is 1. Every other gate is built from combinations of that idea plus De Morgan’s law.

How Do You Make an XOR Gate From Four NAND Gates?

XOR, or “exclusive OR,” outputs 1 when its two inputs are different. Tutorials and Wikipedia agree on a four-gate design, though other, less efficient designs use five or more gates. Here is the standard arrangement:

  1. First gate: NAND the inputs A and B together, and call the result M.
  2. Second gate: NAND input A with M.
  3. Third gate: NAND input B with M.
  4. Fourth gate: NAND the outputs of the second and third gates. This final output is A XOR B.

Wikipedia notes this design has a propagation delay of three times one NAND gate, because a signal can pass through three gates in a row. In a real chip, that delay adds up, which is one reason designers don’t always build everything from NANDs alone.

Why Do Chip Designers Prefer NAND Over NOR?

Both NAND and NOR are universal, but NAND is usually preferred in CMOS. Wikipedia explains that n-MOSFETs have faster charge mobility than p-MOSFETs. In a NAND gate, the series chain is made of the faster nMOS transistors, and the slower pMOS transistors are in parallel. In a NOR gate, it’s the other way around, with slower pMOS transistors in series. That makes NAND gates faster, or smaller for the same speed, in standard CMOS designs.

Wikipedia also notes that in older TTL logic, a NAND built with multiple-emitter transistors needs fewer transistors than a NOR. A two-input CMOS NAND and a two-input CMOS NOR both use four transistors, so the count alone doesn’t separate them. The speed and area advantage comes from how the transistors are arranged.

This isn’t a hard rule. Some memory structures and special circuits use NOR-style layouts where they fit better. But for general logic, NAND is the usual building block, and many standard cell libraries lean on it heavily.

Which Chips Contain NAND Gates?

You can buy NAND gates as single chips. The two classic families are TTL and CMOS. Wikipedia and Electronics Tutorials list the standard part numbers.

Chip Family What’s inside
7400 / 74LS00 TTL Quad 2-input NAND (four gates)
7410 / 74LS10 TTL Triple 3-input NAND
7420 / 74LS20 TTL Dual 4-input NAND
7430 / 74LS30 TTL Single 8-input NAND
4011 / CD4011 CMOS Quad 2-input NAND
4023 / CD4023 CMOS Triple 3-input NAND
4012 / CD4012 CMOS Dual 4-input NAND
4068 CMOS Single 8-input NAND

The 7400 is the one most people meet first. Modern versions, such as the 74HC00, run from a supply of about 2 to 6 volts, according to datasheets, and its HCT cousin is specified at 4.5 to 5.5 volts for TTL-compatible levels. Typical propagation delay for a 74HC00 at 5 volts is in the range of several nanoseconds, but check the datasheet for guaranteed values before designing anything. Many chips are sold in through-hole and surface-mount packages.

When you use a chip with extra gates, you should deal with the unused inputs. Electronics Tutorials notes that unused inputs on a NAND gate can be held HIGH, for example with a pull-up resistor, so they don’t change the result. Leaving a CMOS input floating can cause erratic behavior and extra current draw.

How Is a NAND Gate Used to Store Data?

Two cross-coupled NAND gates form an SR latch, one of the simplest memory circuits. Wikipedia describes it as the most fundamental latch built from static gates. In the NAND version, the inputs are active low, which means they normally rest at 1. Setting S to 0 with R at 1 sets the output Q to 1. Setting R to 0 with S at 1 resets Q to 0. With both at 1, the latch holds its previous state, and that’s how it remembers one bit.

Both inputs low at the same time, S = R = 0, is the forbidden state. Wikipedia says it forces both outputs to 1, which isn’t a valid state because the two outputs should be opposites. Designers avoid it, and more advanced flip-flops add gating to prevent it. Latches and flip-flops like this are the basis of registers and other storage inside processors.

What Does NAND Mean in NAND Flash Memory?

The name of NAND flash storage, used in USB drives and solid-state drives, comes from the logic gate. IBM explains that NAND flash gets its name from the combination of NOT and AND. Sources describe the relationship between the bit lines and the word lines in the memory array as resembling a NAND gate, and NOR flash resembles a NOR gate.

The technology came from Fujio Masuoka’s work at Toshiba. Sources say the NAND version was presented at the IEEE International Electron Devices Meeting in 1987, and that NAND flash is denser and cheaper per bit than NOR flash, with faster erase and write times. NOR flash can read and write individual bytes, while NAND is accessed in pages and blocks. The chip is not a collection of NAND gates doing logic. It just shares the naming idea.

Where Are NAND Gates Used?

Because NAND is universal, it can appear in nearly any digital circuit. GeeksforGeeks lists arithmetic logic units (ALUs), encoders and decoders, multiplexers and demultiplexers, and general logical operations. A multiplexer, which selects one of several inputs, can be built from four NAND gates, according to Wikipedia’s NAND logic page.

In practice, you’ll find NAND gates inside microprocessors, memory controllers, timers and countless simple circuits on hobby boards. Hobbyists use a 7400 or 4011 chip to learn logic, to build latches and oscillators, and to prototype small circuits. Inside a modern processor, millions or billions of gates are arranged by design software, and NAND-type structures are common.

What Are the Advantages and Limits of NAND Gates?

The main advantage is flexibility. One gate type can build everything, which simplifies manufacturing and design. GeeksforGeeks adds that NAND designs can simplify logic expressions, use fewer components in some designs and consume less power than some other gates. In CMOS they’re fast and compact compared with NOR gates.

The limits are practical. Building a complex function from NAND gates alone isn’t always the most optimized design, and chains of gates add propagation delay, which may mean extra gates to fix timing. Large designs also need careful handling of power, noise and timing. For real products, designers use tools that choose the best mix of gates, not just a pure NAND network.

What Mistakes Do Beginners Make With NAND Gates?

The most common error is mixing up NAND and AND. Remember that NAND is the opposite of AND, so its output is LOW only when all inputs are HIGH. A second is leaving unused inputs floating, which can cause random output changes. Tie them HIGH or to a defined level.

Another mistake is forgetting the latch inputs are active low, which makes the circuit seem to work backward. Others include driving two gate outputs together, ignoring the supply voltage range of the chip, and forgetting that the output isn’t instantaneous. Always check the datasheet for supply voltage, current limits and timing.

FAQs About NAND Gates

What is a NAND gate?

A NAND gate is a logic gate that outputs LOW only when all its inputs are HIGH. It’s an AND gate followed by a NOT, and it outputs HIGH for every other input combination.

What is the NAND gate truth table?

For two inputs, A=0,B=0 gives 1, A=0,B=1 gives 1, A=1,B=0 gives 1, and A=1,B=1 gives 0.

What is the Boolean expression of a NAND gate?

Y = NOT(A AND B), written as Y = (A · B)′ or Y = ¬(A∧B). By De Morgan’s law, it also equals (NOT A) OR (NOT B).

What is the symbol of a NAND gate?

It’s the AND gate symbol with a small circle, or bubble, at the output. The bubble shows the output is inverted.

Why is the NAND gate called a universal gate?

Because any other logic gate can be built from NAND gates alone. NOT, AND and OR can all be made from it, and those can build any digital circuit.

What is the NAND gate IC number?

The classic TTL chip is the 7400 (quad 2-input NAND), and the classic CMOS chip is the 4011. Other versions include the 74LS00 and 74HC00.

How many NAND gates does an XOR need?

The standard minimum is four NAND gates. Some designs use five or more.

What is the difference between a NAND gate and a NOR gate?

NAND outputs LOW only when all inputs are HIGH. NOR outputs HIGH only when all inputs are LOW. Both are universal, but NAND is usually faster and smaller in CMOS.

How does a NAND gate work physically?

Transistors act as switches. In a CMOS gate, two nMOS transistors in series pull the output LOW when both inputs are HIGH, and two pMOS transistors in parallel pull it HIGH otherwise.

Is NAND flash the same as a NAND gate?

No. NAND flash is storage memory named for a similar structure. It doesn’t work like a logic gate chip.

Conclusion

A NAND gate gives a LOW output only when every input is HIGH, and it’s HIGH otherwise. That simple rule, combined with the fact that it’s universal, makes it one of the most important building blocks in digital electronics.

If you’re learning, memorize the truth table, practice building NOT, AND, OR and XOR from NAND gates, and try wiring a 7400 or 4011 on a breadboard. Once you can build a latch from two NANDs, you’ve seen how logic turns into memory.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *