Logic gates, explained with the actual symbols
Paper I asks you to identify a gate from its symbol or complete its truth table. Paper II asks you to write or simplify a Boolean expression. Both come from the same seven gates below — learn the symbol and the one row that makes each gate distinct from its closest lookalike.
AND, OR, NOT වගේ logic gates වල truth table සහ symbols මෙතන සරලව පැහැදිලි කර ඇත.
Converting between number systems first? Binary, hex and two's complement, worked step by step.
AND gate
Q = A · BAND ගේට්
A B Q 0 0 0 0 1 0 1 0 0 1 1 1 Output is 1 only when both inputs are 1.
Drawn as a switches-in-series circuit almost every year — both switches must close for the lamp to light.
OR gate
Q = A + BOR ගේට්
A B Q 0 0 0 0 1 1 1 0 1 1 1 1 Output is 1 when at least one input is 1.
The switches-in-parallel circuit — either switch alone lights the lamp.
NOT gate
Q = A′NOT ගේට්
A Q 0 1 1 0 Output is the opposite of the single input — also called an inverter.
The building block for every other inverted gate below — learn this one truth table cold.
NAND gate
Q = (A · B)′NAND ගේට්
A B Q 0 0 1 0 1 1 1 0 1 1 1 0 AND, then inverted — output is 0 only when both inputs are 1.
A NAND gate with its two inputs tied together behaves exactly like a NOT gate — a favourite short-answer question.
NOR gate
Q = (A + B)′NOR ගේට්
A B Q 0 0 1 0 1 0 1 0 0 1 1 0 OR, then inverted — output is 1 only when both inputs are 0.
Easy to mix up with NAND under exam pressure — check the ONE row that differs (both inputs 0) to tell them apart fast.
XOR gate
Q = A ⊕ BXOR ගේට්
A B Q 0 0 0 0 1 1 1 0 1 1 1 0 Output is 1 when the two inputs differ.
Looks like OR except for one row (1,1) — that row is exactly what distinguishes them, and it's a common trick question.
XNOR gate
Q = (A ⊕ B)′XNOR ගේට්
A B Q 0 0 1 0 1 0 1 0 0 1 1 1 Output is 1 when the two inputs are the same.
The "equality checker" gate — 1 out means A and B agree.
De Morgan's theorem, proved rather than stated
(A·B)′ is meant to behave exactly like A′+B′. Instead of taking that on faith, check every row of both truth tables side by side:
| A | B | (A·B)′ | A′+B′ | Match? |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | |
| 0 | 1 | 1 | 1 | |
| 1 | 0 | 1 | 1 | |
| 1 | 1 | 0 | 0 |
Every row matches, so the two expressions are equivalent — which is exactly what an exam question asking you to "prove De Morgan's theorem using a truth table" wants to see. The mirror rule, (A+B)′ = A′·B′, is proved the same way.
Questions students ask
How many logic gates are there in the A/L ICT syllabus?
Seven basic gates: AND, OR, NOT, NAND, NOR, XOR and XNOR. NAND and NOR are sometimes called "universal gates" because either one alone can be wired up to build every other gate — a common structured-question angle.
What is the fastest way to tell NAND and NOR apart under exam pressure?
Check only the row where both inputs are 0. NOR outputs 1 there (nothing is on, so "neither" is true); NAND outputs 1 everywhere except when both inputs are 1. If you can't remember the whole table, that one row is enough to identify which gate you're looking at.
What's the difference between OR and XOR?
They agree on three of the four input rows and differ on exactly one: when both inputs are 1, OR outputs 1 but XOR outputs 0. XOR means "one or the other, but not both."
What is De Morgan's theorem, in plain terms?
It states that (A·B)′ = A′ + B′, and separately (A+B)′ = A′·B′ — in words, "NOT (A AND B)" behaves exactly like "(NOT A) OR (NOT B)", and "NOT (A OR B)" behaves like "(NOT A) AND (NOT B)". You can prove either version by building both truth tables and checking every row matches.
More free A/L ICT resources
- Free ICT notes & past papers
- Past papers, used the right way
- The full syllabus, unit by unit
- A revision plan, especially for repeats
- Exam command words explained
- 10 worked "distinguish between" answers
- Number systems & two's complement
- Where A/L ICT can take you
- Dr. Yasas Sri Wickramasinghe — lecturer profile
Drill this under real exam pressure
Every subject's Practice section includes gate-identification and truth-table questions with instant marking, plus the full digital circuits unit taught live.
Join a class