Logic circuits, truth tables and logic expressions Cambridge IGCSE Computer Science (9–1) revision
Not started
Learn it
In plain words
Join gates together and you have a logic circuit. The same circuit can be described in three ways: as a drawing, as a truth table, and as a logic expression such as X = (A AND B) OR (NOT C). The skill is moving between the three.
5 things to know
- A circuit with three inputs has eight rows in its truth table. Write them in binary counting order: 000, 001, 010, 011, 100, 101, 110, 111.
- To complete a truth table, add a column for the output of each gate inside the circuit. Work out those columns first, then the final output.
- To write an expression from a circuit, start at the inputs and write down what each gate does, using brackets to keep each gate's inputs together.
- To draw a circuit from an expression, draw one gate for each operator, working from inside the brackets outwards.
- From a problem statement: "and" becomes an AND gate, "or" becomes an OR gate, and "not" becomes a NOT gate. Draw the circuit as the statement is given, without simplifying it.
Worked example
Complete the truth table for X = (A AND B) OR (NOT C).
- Work out A AND B for the eight rows: 0, 0, 0, 0, 0, 0, 1, 1.
- Work out NOT C for the eight rows: 1, 0, 1, 0, 1, 0, 1, 0.
- OR the two columns together, row by row.
- X = 1, 0, 1, 0, 1, 0, 1, 1.
Worked example
An alarm (X) sounds if the system is switched on (S) and either a door is open (D) or a window is open (W). Write the logic expression.
- "Either a door or a window" is D OR W.
- That must happen together with the system being on: S AND (D OR W).
- X = S AND (D OR W).
Tips and tricks
- Use the working columns. Trying to do a three-gate circuit in your head, eight times, is how rows go wrong.
- Brackets matter. (A AND B) OR C is a different circuit from A AND (B OR C).
It lands in your notebook with its questions as flashcards.
Logic circuits, truth tables and logic expressions: 6 questions and answers
These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.
How many rows does a truth table for a circuit with three inputs have?
2 × 2 × 2 combinations of inputs.
A light (X) comes on if it is dark (D) and movement is detected (M). Which expression is correct?
Both conditions are needed.
What is the value of (A OR B) AND (NOT C) when A = 1, B = 0 and C = 1?
A OR B is 1, but NOT C is 0, and 1 AND 0 is 0.
What is the value of (A AND B) OR C when A = 1, B = 1 and C = 0?
A AND B is 1, and 1 OR 0 is 1.
Which single gate does the expression X = NOT (A AND B) describe?
NAND is AND followed by NOT.
Which expression matches this statement: X is 1 if A is 1, or if B is 1 and C is not 1?Stretch
The "or" joins A to the whole of "B and not C".
Quiz
6 questions
Tap an answer and you’ll see straight away whether it’s right, and why.




0 / 0
Worth another look
Worksheet
2 questions, 6 marks. Write your answers on paper, then check them.
Logic circuits, truth tables and logic expressions
Cambridge IGCSE Computer Science (9–1) 0984 · 6 marks · papermunch.org
Name ______________________________ Date ______________
Write a logic expression for this statement: X is 1 if A is 1 and B is not 1.[2]
Show answerHide answer
X = A AND (NOT B)
Complete the output column of the truth table for X = (A OR B) AND (NOT C), for the rows 000 to 111 in order.[4]
Show answerHide answer
0, 0, 1, 0, 1, 0, 1, 0.
Answers: Logic circuits, truth tables and logic expressions
- 1. X = A AND (NOT B)
- 2. 0, 0, 1, 0, 1, 0, 1, 0.