NOT
X = NOT A
Reverses the input. A 0 becomes 1, and a 1 becomes 0.
Loading…
Free A-Level Computer Science revision guide
Apply the six standard gates, trace multi-stage circuits and use Boolean reasoning in original OCR, AQA and Cambridge International A-Level practice questions.
Content owner: Michael Print · Reviewed against current exam-board specifications
A logic gate takes one or more binary inputs and produces one binary output. Each value is either 0 or 1. Depending on the context, these may mean false and true, off and on, or low and high voltage.
A truth table lists every possible input combination and the corresponding output. For two inputs there are four combinations: 00, 01, 10 and 11. For three inputs there are eight.
OCR H446, AQA 7517 and Cambridge International 9618 all include logic gates and Boolean reasoning. Their notation, algebra and simplification requirements differ, so use your examination-year specification alongside these examples.
Start with the rule for each gate, then connect it to the expression and truth table.
X = NOT A
Reverses the input. A 0 becomes 1, and a 1 becomes 0.
X = A AND B
Outputs 1 only when both inputs are 1.
X = A OR B
Outputs 1 when at least one input is 1.
X = A XOR B
Outputs 1 when the two inputs are different.
X = NOT (A AND B)
The inverse of AND. It outputs 0 only when both inputs are 1.
X = NOT (A OR B)
The inverse of OR. It outputs 1 only when both inputs are 0.
Learn the rule for each gate rather than memorising an unexplained grid. NAND is the opposite of AND, while NOR is the opposite of OR.
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
For X = NOT ((A XOR B) AND C), draw the inner XOR first. The entire AND result is inverted, so a NAND gate can perform the final AND and NOT together. Keep the inversion circle on the NAND output; without it, the circuit represents a different expression.
Check the expression against the drawing by naming each intermediate output: D = A XOR B, then X = NOT (D AND C).
Worked example
If A = 1, B = 0 and C = 0, first calculate A AND B = 0. Next calculate NOT C = 1. The final operation is 0 OR 1, so X = 1.
Writing the two intermediate results prevents you from trying to evaluate the complete expression in one step.
NOT (NOT A) = A
NOT (A AND B) = (NOT A) OR (NOT B)
NOT (A OR B) = (NOT A) AND (NOT B)
Independent practice material
Attempt each question before opening its solution. These questions and solutions are original practice material and are not taken from an examination paper or mark scheme.
Name the gate described by each statement.
A circuit is represented by X = (A AND B) OR NOT C. Construct a truth table containing A, B, C, both intermediate results and X.
| A | B | C | A AND B | NOT C | X |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
Suggested marking: one mark for each correct intermediate column and up to three marks for the final output column.
Cambridge International 9618-aligned practice
A security alarm should sound only when the system is armed and at least one of the door or window sensors reports that it is open.
Alarm = Armed AND (DoorOpen OR WindowOpen)
For Armed = 1, DoorOpen = 0 and WindowOpen = 1, Alarm = 1.
For Armed = 0, DoorOpen = 1 and WindowOpen = 1, Alarm = 0.
Suggested marking: two marks for the complete expression and one for each output.
OCR H446-aligned practice
Use De Morgan's law to rewrite NOT (A OR B). Explain how the rewritten expression could be implemented without a NOR gate, and state which input combination produces an output of 1.
A NOR gate produces NOT (A OR B).
Using De Morgan's law, this is equivalent to (NOT A) AND (NOT B).
Therefore, invert A and B separately and connect those two results to an AND gate.
Both forms produce 1 only for A = 0 and B = 0; they produce 0 for 01, 10 and 11.
AQA 7517-aligned practice
Two temperature sensors produce signals T and S. A fault is suspected when the sensors disagree, but the fault indicator must operate only while monitoring E is enabled.
F = (T XOR S) AND E
Construct a truth table with an intermediate T XOR S column, then explain when F is 1.
| T | S | E | T XOR S | F |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 |
The output is 1 only when monitoring is enabled and the two sensors disagree. The XOR gate detects disagreement; the AND gate then checks E.
AQA 7517-aligned · six-mark written answer. One circuit implements X = (A AND B) OR (A AND NOT B). Another connects A directly to X. Explain with Boolean reasoning and a truth-table check whether the circuits are equivalent for every value of A and B.
Model answer: Factor out A to get X = A AND (B OR NOT B). The bracket is always 1, so X = A AND 1 = A. A four-row truth table gives the same outputs for both circuits.
| A | B | A AND B | A AND NOT B | X | Direct A |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 0 | 1 | 1 |
Indicative marks: factor A (1); B OR NOT B = 1 (1); simplify to X = A (1); correct four-row check (2); explicit equivalence conclusion (1).
No. OR outputs 1 when one or both inputs are 1. XOR outputs 1 only when exactly one input is 1.
For n binary inputs, it needs 2ⁿ rows. Two inputs need four rows and three inputs need eight.
Yes. They show your method, reduce mistakes and may earn marks even when the final output contains an error.
No. They are independently authored practice questions designed to help you apply the underlying Computer Science concepts.
Logic and Boolean operations appear in Cambridge International AS & A Level Computer Science 9618. Always check the syllabus year supplied by your school for the exact notation and depth required.
View Cambridge International tuition supportThe worked questions cover selected skills. OCR H446 includes Boolean algebra and Karnaugh maps; AQA 7517 includes circuit interpretation and simplification; Cambridge International 9618 includes constructing circuits, expressions and truth tables. Check the syllabus for your exam year for the full scope.
This is independently authored educational material. CompSciTutoring.co.uk is not affiliated with or endorsed by Cambridge International Education or any other examination board.
Work through truth tables, Boolean expressions and unfamiliar questions in a focused one-to-one lesson.