An XOR gate has inputs A = 1 and B = 0. What is the output?
- 0
- It depends on the order
- 1
- Undefined
Mark scheme: 1 mark for 1, because XOR is true when the two inputs are different, and here they are.
This topic is about the machine itself: what it is made of, how it thinks in ones and zeros, what software runs on it, and how the hardware inside it works. It is where the ideas of the data representation topic meet physical components — a bus carries the bits, a register holds them, the clock times them. Much of this topic is definitional, and exam questions reward precise terms, so learn the vocabulary and then the reasoning behind it.
The four gates
Construct truth tables for the following logic gates: NOT, AND, OR and XOR. Students do not need to know about or use NAND and NOR logic gates. NOT reverses its input. AND is true only when both inputs are true. OR is true when at least one input is true. XOR is true when the inputs are different — that is exactly one of them, never both.
Key fact: Four gates only: NOT, AND, OR and XOR. NAND and NOR are not needed.
Building truth tables
A truth table lists every possible combination of the inputs and the output for each. For two inputs there are four rows: 00, 01, 10, 11. For three inputs there are eight. Students should be able to construct truth tables which contain up to three inputs, so write all the rows, even the ones you think are obvious — the rows are where the marks are.
Key fact: Two inputs means 4 rows, three inputs means 8 rows. Write every row.
Reading the gates
Interpret the results of simple truth tables, and construct truth tables for simple logic circuits using combinations of NOT, AND, OR and XOR gates. The rule is simple: work through each combination of inputs, and for each one, work out what each gate does in turn and carry the result forward. Do one column at a time rather than trying to hold the whole table in your head.
Key fact: Work through one combination of inputs at a time, applying each gate in turn.
Circuit diagrams
Create, modify and interpret simple logic circuit diagrams, using only NOT, AND, OR and XOR gates, with up to three inputs. The symbols are standard: a triangle with a bubble for NOT, a flat-backed D-shape for AND, a curved-back shape for OR, and OR with an extra curve on the input side for XOR. You have to be able to draw them, so practise the shapes rather than just the names.
Key fact: Learn the four standard symbols; you must be able to draw a circuit with up to three inputs.
Boolean expressions
Create and interpret simple Boolean expressions made up of NOT, AND, OR and XOR operations. The operators are written . for AND, + for OR, ⊕ for XOR, and an overbar for NOT. So (A AND B) OR (NOT C) is written A.B + C̅. A dot means AND, a plus means OR, and the bar over the C negates it.
Key fact: Boolean notation: . is AND, + is OR, ⊕ is XOR, and a bar over a letter is NOT.
Both directions
Create the Boolean expression for a simple logic circuit, and create a logic circuit from a simple Boolean expression. So a question might show you a picture with an AND gate and an OR gate and ask for the expression, or give you A.B + C̅ and ask you to draw it. Work from the inside out in both directions, and check your answer by evaluating it at one input combination and comparing with the circuit.
Key fact: Convert in both directions and check your answer at one input combination.
Which four logic gates must you know?
NOT, AND, OR and XOR.
Which gates do you not need to know about?
NAND and NOR.
When is an XOR gate true?
When the two inputs are different — exactly one is true, never both.
When is an AND gate true?
Only when both inputs are true.
When is an OR gate true?
When at least one of the inputs is true.
How many rows does a truth table with three inputs have?
8, because there are 2³ combinations of the inputs.
What does a bar over a letter mean in a Boolean expression, and what do a dot and a plus mean?
A bar means NOT, so C̅ is NOT C. A dot means AND and a plus means OR.
Written in the style of AQA Computer Science, with a mark scheme for each one. No question here is a real past paper question.
An XOR gate has inputs A = 1 and B = 0. What is the output?
Mark scheme: 1 mark for 1, because XOR is true when the two inputs are different, and here they are.
Explain in English how you would construct a truth table for a circuit that combines two gates, and how you would convert it into a Boolean expression.
Mark scheme: 1 mark for explaining that you list every combination of the inputs and work through each one applying each gate in turn. 1 mark for explaining that for two inputs there are four rows and for three inputs eight rows. 1 mark for explaining that the expression is built by replacing each gate with its operator: AND becomes a dot, OR becomes a plus, XOR becomes ⊕, and NOT becomes a bar over the relevant part.
Explain in English the four logic gates, how truth tables are constructed, and how a Boolean expression is built from a circuit.
Mark scheme: Level 1 (1-2 marks): A short answer naming the gates and saying a truth table lists the output for each combination of inputs. Level 2 (3-4 marks): A structured answer covering each gate's truth table and the notation. Level 3 (5-6 marks): A detailed answer giving the truth conditions of NOT, AND, OR and XOR and noting that NAND and NOR are not required, explaining that a truth table has 2ⁿ rows and that each row is evaluated by applying the gates in turn, explaining the standard circuit symbols, and explaining that a Boolean expression replaces each gate with its operator — dot for AND, plus for OR, ⊕ for XOR and a bar for NOT — so (A AND B) OR (NOT C) is A.B + C̅.
Answer them in the interactive view and they get marked against the same mark scheme, one mark at a time, with the reason for each mark.
Open the interactive topic →