You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
The AND gate is one of the three fundamental logic gates. It takes two inputs and produces one output. The output is 1 (TRUE) only when both inputs are 1. In all other cases, the output is 0.
The AND gate checks whether all of its inputs are true. For a two-input AND gate:
Think of the AND gate as a strict bouncer at a nightclub — you need both a valid ID AND a ticket to get in. If you are missing either one, you are turned away.
| Input A | Input B | Output (A ∧ B) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
The block view of the gate:
graph LR
A((A)) --> AND["AND"]
B((B)) --> AND
AND --> Q((Q = A AND B))
Notice that the output is 1 in only one row — the row where both inputs are 1. This is the defining characteristic of the AND gate.
Exam Tip: When completing a truth table for an AND gate, remember that the output is 1 ONLY when ALL inputs are 1. For a two-input AND gate, that means only 1 out of 4 rows gives an output of 1.
The standard symbol for a two-input AND gate:
A ----\
| AND |---- Output (A ∧ B)
B ----/
More precisely, the AND gate symbol has a flat left edge and a curved right edge (like the letter D):
+------\
A ----| )---- Output
B ----| )
+------/
The Boolean expression for a two-input AND gate can be written in several ways:
All three notations are acceptable in GCSE exams. The ∧ symbol and the · (dot) are the most commonly seen.
The AND operation is sometimes compared to multiplication because:
This pattern matches ordinary multiplication with 0s and 1s.
Imagine two light switches wired in series (one after the other). The light only turns on when both switches are in the ON position. If either switch is OFF, the circuit is broken and the light stays off.
Battery ---[ Switch A ]---[ Switch B ]--- Light
A bank vault door might require both a key card AND a PIN code to unlock. If you only have one, the door stays locked. This is an AND condition.
In programming, the AND operation is used to check that multiple conditions are all true:
Python:
temperature = 25
is_sunny = True
if temperature > 20 and is_sunny:
print("Let's go to the park!")
Both conditions (temperature > 20 and is_sunny) must be true for the message to be printed.
JavaScript:
if (age >= 18 && hasLicence) {
console.log("You can drive.");
}
In Python, the keyword is and. In JavaScript, Java and C#, the symbol && is used.
Although most GCSE questions use two-input AND gates, it is possible to have AND gates with three or more inputs. The rule remains the same — the output is 1 only when ALL inputs are 1.
For a three-input AND gate (A ∧ B ∧ C):
| A | B | C | Output |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Only the final row produces an output of 1 — when A, B and C are all 1.
These properties are useful when simplifying Boolean expressions.
and / &&) checks that all conditions are true.This is the canonical AND truth table — you must commit it to memory.
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
A three-input AND gate (A ∧ B ∧ C) can be built from two two-input AND gates.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.