Logic gates and truth tables
A logic gate takes one or two inputs, each 0 or 1, and gives one output. The syllabus covers six gates. You need to know their symbols and truth tables, and be able to work out the output of a whole expression or circuit.
The six gates
- NOT: one input; the output is the opposite of the input.
- AND: the output is 1 only when both inputs are 1.
- OR: the output is 1 when at least one input is 1.
- NAND: NOT AND. The output is 0 only when both inputs are 1.
- NOR: NOT OR. The output is 1 only when both inputs are 0.
- XOR: the output is 1 when the inputs are different.
Truth tables
A truth table lists every combination of inputs with the output for each. Two inputs give 4 rows and three inputs give 8. Write the inputs as counting in binary from 000 to 111 so no combination is missed.
For a longer expression, add a working column for each part. For X = (A OR B) AND NOT C, work out A OR B, then NOT C, then AND those two columns together. The working columns aren’t marked, but they stop slips.
From a problem to an expression
Problem statements are written in words: “the alarm sounds if the door is open or the window is open, and the system is not switched off”. Name each condition as an input, turn “and”, “or” and “not” into gates, and use brackets to show which parts go together: X = (D OR W) AND NOT S.
Where marks go
- Missing input combinations: a three-input table needs all 8 rows.
- Mixing up NAND and NOR, or OR and XOR, when both inputs are 1.
- Leaving out brackets, so the expression means something different.
- Drawing gate symbols that can’t be told apart, such as an OR without its curved back, or a NOT without its circle.
- Working out the whole expression in one step instead of using working columns.