You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
NAND and NOR gates are derived from the fundamental AND and OR gates by adding a NOT operation to the output. They are extremely important in computing because each one alone can be used to build any other logic gate — a property known as functional completeness.
NAND stands for NOT AND. A NAND gate produces the opposite output to an AND gate. It is equivalent to an AND gate followed by a NOT gate.
This is the exact inverse of the AND gate.
| Input A | Input B | AND (A ∧ B) | NAND ¬(A ∧ B) |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
The NAND output column is the opposite of the AND output column.
The NAND gate symbol is an AND gate with a bubble (small circle) at the output — the bubble indicates the NOT (inversion):
+------\
A ----| )o---- Output ¬(A ∧ B)
B ----| )
+------/
¬(A ∧ B) or equivalently NOT (A AND B)
The overline notation is: (A · B) with a bar over the entire expression.
NOR stands for NOT OR. A NOR gate produces the opposite output to an OR gate. It is equivalent to an OR gate followed by a NOT gate.
This is the exact inverse of the OR gate.
| Input A | Input B | OR (A ∨ B) | NOR ¬(A ∨ B) |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 |
The NOR output column is the opposite of the OR output column.
The NOR gate symbol is an OR gate with a bubble at the output:
+------\
A ----| \
| )o---- Output ¬(A ∨ B)
B ----| /
+------/
¬(A ∨ B) or equivalently NOT (A OR B)
The block diagrams below show each compound gate as its base gate plus a NOT, side by side:
graph LR
subgraph NAND["NAND = NOT (A AND B)"]
A1((A)) --> AND1["AND"]
B1((B)) --> AND1
AND1 --> N1["NOT"] --> Q1((Q))
end
subgraph NOR["NOR = NOT (A OR B)"]
A2((A)) --> OR2["OR"]
B2((B)) --> OR2
OR2 --> N2["NOT"] --> Q2((Q))
end
| Gate | Output is 1 when... | Rows with output 1 | Expression |
|---|---|---|---|
| AND | Both inputs are 1 | 1 out of 4 | A ∧ B |
| OR | At least one input is 1 | 3 out of 4 | A ∨ B |
| NOT | Input is 0 | 1 out of 2 | ¬A |
| XOR | Inputs are different | 2 out of 4 | A ⊕ B |
| NAND | NOT both inputs are 1 | 3 out of 4 | ¬(A ∧ B) |
| NOR | Both inputs are 0 | 1 out of 4 | ¬(A ∨ B) |
Exam Tip: Notice the symmetry: NAND has the same number of 1s in its output as OR (3 out of 4), and NOR has the same number as AND (1 out of 4). This is because NAND is the inverse of AND, and NOR is the inverse of OR.
Both NAND and NOR are called universal gates because either one alone can be used to construct any other logic gate (NOT, AND, OR, XOR and each other). This is called functional completeness.
Connect both inputs of a NAND gate to the same signal:
+------\
A ----| )o---- Output (¬A)
A ----| )
+------/
When A = 0: NAND(0, 0) = 1 (same as NOT 0 = 1). When A = 1: NAND(1, 1) = 0 (same as NOT 1 = 0).
Use two NAND gates — the first performs NAND, the second inverts the result (acting as NOT):
+------\ +-----\
A ----| )o---+----| >o---- Output (A ∧ B)
B ----| ) +----| >
+------/ +-----/
Use three NAND gates — two acting as NOT gates on each input, feeding into a third NAND gate.
This universal property is why NAND gates are the most commonly used gates in real integrated circuits — manufacturers can build entire processors using only NAND gates.
In the real world, NAND and NOR gates are used in:
| Property | NAND | NOR |
|---|---|---|
| Full name | NOT AND | NOT OR |
| Output is 0 when... | Both inputs are 1 | Any input is 1 |
| Output is 1 when... | Not both inputs are 1 | Both inputs are 0 |
| Equivalent to... | AND + NOT | OR + NOT |
| Symbol identifier | AND shape + bubble | OR shape + bubble |
Note on the AQA specification: Like XOR, NAND and NOR are not separately listed in AQA GCSE Computer Science (8525) section 3.4.2; only AND, OR and NOT are required. They are taught here because their behaviour is easily expressed using AND/OR/NOT, and they help build understanding of De Morgan's laws and Boolean simplification.
NAND is "NOT AND" — the opposite of AND.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.