Truth tables

    Edexcel
    GCSE
    Computer Science

    Master the logic behind digital systems with this comprehensive guide to Truth Tables. Learn how to map out every possible outcome for AND, OR, and NOT gates, ensuring you never drop a mark on these satisfying, puzzle-like exam questions.

    11
    Min Read
    3
    Examples
    5
    Questions
    6
    Key Terms
    🎙 Podcast Episode
    Truth tables
    0:00-0:00

    Study Notes

    Truth Tables and Logic Gates

    Overview

    Welcome to Truth Tables, the foundational tool for understanding how computers process logic. At its core, a computer only understands binary: 1s (True/On) and 0s (False/Off). Truth tables allow us to map out exactly how a system will behave given any possible combination of these binary inputs.

    In your GCSE Computer Science exam, you will be expected to construct and complete truth tables for single logic gates and combined logic circuits with up to three inputs. This topic is heavily assessed because it forms the basis of all digital electronics and programming logic. Examiners will test your ability to work systematically, apply logical operators accurately, and avoid careless errors.

    Listen to the audio guide below for a comprehensive walk-through of the core concepts, common pitfalls, and a quick-fire recall quiz to test your knowledge:

    GCSE Computer Science Podcast: Truth Tables

    Key Concepts

    Concept 1: The AND Gate

    The AND operator is strict. For an AND gate to output a 1 (True), BOTH inputs must be 1. If even a single input is 0, the output is 0. Think of it like a bouncer at a club: you need both a ticket AND ID to get in. If you only have one, or neither, you are denied entry (0).

    Example:

    • Input A = 1, Input B = 0 → Output = 0
    • Input A = 1, Input B = 1 → Output = 1

    Concept 2: The OR Gate

    The OR operator is much more relaxed. It will output a 1 (True) if AT LEAST ONE of the inputs is 1. The only time an OR gate outputs a 0 is when both inputs are 0. Think of it like applying for a job that requires either a degree OR relevant experience. Having both is great, having one is fine, but having neither means you don't get the job (0).

    Example:

    • Input A = 0, Input B = 1 → Output = 1
    • Input A = 0, Input B = 0 → Output = 0

    Concept 3: The NOT Gate

    The NOT operator is beautifully simple. It only takes a single input and simply inverts it. If the input is 1, the output is 0. If the input is 0, the output is 1. It is often referred to as an inverter.

    Example:

    • Input A = 1 → Output = 0
    • Input A = 0 → Output = 1

    Logic Operators Quick Reference

    Concept 4: Constructing a 3-Input Truth Table

    When dealing with three inputs (typically A, B, and C), your truth table must account for every possible combination. The number of rows is calculated as 2^n, where n is the number of inputs. Therefore, 3 inputs require 2^3 = 8 rows.

    Examiners look for a systematic approach to filling in the input columns to ensure no combinations are missed or duplicated. The standard pattern is:

    • Column A: Four 0s, followed by four 1s.
    • Column B: Two 0s, two 1s, two 0s, two 1s.
    • Column C: Alternating 0, 1, 0, 1, 0, 1, 0, 1.

    How to structure a 3-input truth table

    Mathematical/Scientific Relationships

    • Row Calculation Formula: \text{Number of Rows} = 2^n
      • Where n is the number of inputs.
      • Must memorise: You will need this to check you have constructed tables of the correct size.

    Practical Applications

    Truth tables aren't just abstract concepts; they are used every day by software engineers and electronics designers.

    • Search Engines: When you search for "GCSE AND Computer Science", the search engine uses logic to only return pages containing both terms.
    • Smart Home Systems: A security light might turn on if (Motion Detected = 1) AND (It is Night = 1).
    • Circuit Design: Engineers use truth tables to simplify complex physical circuits, saving money on components.

    Podcast Script

    The full script for the audio guide truth_tables_podcast.mp3 is provided here for reference and revision.

    Hello and welcome to your GCSE Computer Science revision podcast. I'm so glad you're here, because today we're diving into one of the most satisfying topics in the whole specification — Truth Tables. Yes, I said satisfying! And by the end of this episode, I think you'll agree with me.

    So here's the deal. Truth tables are a way of showing every possible combination of inputs to a logical system, and working out what the output will be. They're used in computer science because computers think in binary — everything is either a zero or a one, off or on, false or true. And truth tables let us map out exactly how a circuit or a program will behave.

    Now, there are three logical operators you absolutely need to know for your GCSE. These are AND, OR, and NOT. Let me walk you through each one, because once you truly understand them, completing any truth table becomes almost automatic.

    Let's start with the AND operator. AND is the strictest of the three. Think of it like a bouncer at a very exclusive club. BOTH inputs have to be a one — that's true — for the output to be a one. If even one input is a zero, the output is zero. Full stop.

    So if I give you inputs A and B, the AND gate gives us: zero AND zero equals zero. Zero AND one equals zero. One AND zero equals zero. And only one AND one equals one. That's four rows, covering every possible combination of two inputs. Remember: AND means ALL must agree.

    Now let's look at OR. OR is much more relaxed. The output is one — that's true — as long as AT LEAST ONE input is a one. The only time OR gives you a zero output is when BOTH inputs are zero. So: zero OR zero equals zero. Zero OR one equals one. One OR zero equals one. One OR one equals one. Three ones and only one zero. OR is generous — it just needs someone to show up.

    And finally, NOT. NOT is beautifully simple. It only has one input, and it just flips it. If the input is zero, the output is one. If the input is one, the output is zero. That's it. NOT is the opposite operator. Some people call it an inverter, and that's exactly what it does — it inverts the signal.

    Now here's where it gets really interesting. In your exam, you'll often be asked to combine these operators — sometimes with three inputs. And this is where candidates can lose marks if they haven't practised.

    When you have three inputs — let's call them A, B, and C — your truth table needs eight rows. Why eight? Because two to the power of three is eight. You have three inputs, each can be zero or one, so there are two times two times two possible combinations. That's eight. Always check: number of rows equals two to the power of the number of inputs.

    Here's my foolproof method for filling in the input columns without making mistakes. For the first column — column A — write four zeros, then four ones. For the second column — column B — write two zeros, two ones, two zeros, two ones. For the third column — column C — alternate: zero, one, zero, one, zero, one, zero, one. If you do this every single time, you will never miss a combination. It's a systematic pattern, and examiners love systematic working.

    Let me give you a real example. Suppose the question asks you to complete a truth table for the expression: A AND B, and then NOT that result. So the output is NOT of A AND B. First, I'd work out A AND B as an intermediate column. Then I'd apply NOT to that column to get the final output. Working in stages like this — using intermediate columns — is a technique that earns you marks and prevents errors. Examiners give credit for correct intermediate working even if your final answer has a slip.

    Right, let's talk exam technique. This is where I see candidates throw away marks that they absolutely could have had.

    First up: always account for every possible combination of inputs. If you have two inputs, that's four rows. Three inputs, eight rows. If your table has fewer rows than it should, you will lose marks — guaranteed. Before you write a single output value, count your rows.

    Second: read the question carefully to identify which operators are being used. The question might use words like AND, OR, NOT, or it might show you a logic circuit diagram and ask you to derive the truth table from it. Either way, identify each gate, work through it systematically, and use intermediate columns. I cannot stress this enough — intermediate columns are your best friend.

    Third: double-check your NOT gates. This is the most common error I see. Candidates correctly work out an AND or OR result, and then forget to flip it when a NOT gate is applied. The NOT gate inverts — zero becomes one, one becomes zero. Every. Single. Time.

    Fourth: watch out for the command word. If the question says "complete" the truth table, you just need to fill in the output column — and possibly some intermediate columns. If it says "construct" the truth table, you need to draw the whole thing from scratch, including all input columns. These are different tasks, so read carefully.

    Now, a word on marks. Truth table questions are typically worth between two and six marks. Each correct row in the output column usually earns one mark, or marks are awarded for each correct column. Either way, every row matters. Don't rush and make silly errors in the last couple of rows — that's where tired candidates slip up.

    Let me also mention combined expressions. You might see something like: output equals A AND B, OR C. How do you tackle this? You work from the inside out, following the order of operations. First, calculate A AND B. Write that as an intermediate column. Then, take that result and OR it with C. That gives you your final output. Step by step, column by column. Never try to do it all in your head.

    One more tip: if you're given a logic circuit diagram rather than a written expression, trace the signal path from inputs to output. Start at the inputs, apply each gate in sequence, and note the output of each gate before moving to the next. It's like following a recipe — do it in order and you won't go wrong.

    Alright, now let's do a quick-fire recall quiz. I'll ask the questions, you pause the podcast and think of your answer, then I'll give you the correct response. Ready? Let's go.

    Question one. How many rows does a truth table with three inputs need? The answer is eight. Two to the power of three equals eight.

    Question two. For an AND gate with inputs A equals one and B equals zero, what is the output? The output is zero. AND requires BOTH inputs to be one.

    Question three. For an OR gate with inputs A equals zero and B equals one, what is the output? The output is one. OR only needs at least one input to be one.

    Question four. What does a NOT gate do to an input of zero? It outputs one. NOT inverts the input.

    Question five. If A AND B gives an output of one, what does NOT of A AND B give? It gives zero. NOT flips the one to a zero.

    How did you do? If you got all five, brilliant — you've got the fundamentals locked in. If you missed any, go back and re-read the section on that operator. No shame in it — that's exactly what retrieval practice is for.

    Let's wrap up with a quick summary of everything we've covered today.

    Number one: AND outputs one only when ALL inputs are one. Think: AND means ALL must agree.

    Number two: OR outputs zero only when ALL inputs are zero. Think: OR needs at least ONE.

    Number three: NOT simply inverts the input. Zero becomes one, one becomes zero.

    Number four: the number of rows in a truth table equals two to the power of the number of inputs. One input: two rows. Two inputs: four rows. Three inputs: eight rows.

    Number five: always fill input columns systematically — halving the pattern as you move from left to right.

    Number six: use intermediate columns for complex expressions. Work step by step.

    Number seven: double-check your NOT gates. They are the most common source of errors.

    That's it for today's episode. You've covered everything you need to tackle truth table questions with confidence in your GCSE Computer Science exam. Keep practising, keep testing yourself, and remember — every row in that truth table is a mark waiting to be earned. You've got this. Good luck, and I'll see you in the next episode!

    Visual Resources

    2 diagrams and illustrations

    How to structure a 3-input truth table
    How to structure a 3-input truth table
    Logic Operators Quick Reference
    Logic Operators Quick Reference

    Interactive Diagrams

    2 interactive diagrams to visualise key concepts

    Conceptual Flow Outline

    Input A
    AND Gate
    AND Gate
    Intermediate (A AND B)
    Input B
    AND Gate
    Intermediate (A AND B)
    NOT Gate
    NOT Gate
    Final Output Z

    Signal flow for the expression Z = NOT(A AND B)

    Conceptual Flow Outline

    Start Question
    Count Inputs
    Count Inputs
    2 InputsDraw 4 Rows
    3 InputsDraw 8 Rows
    Draw 4 Rows
    Fill Input Columns Systematically
    Draw 8 Rows
    Fill Input Columns Systematically
    Fill Input Columns Systematically
    Are there brackets?
    Are there brackets?
    YesCreate Intermediate Column for Brackets
    NoProcess First Gate
    Create Intermediate Column for Brackets
    Process First Gate
    Process First Gate
    Complete Final Output Column

    Exam strategy flowchart for tackling truth table questions

    Worked Examples

    3 detailed examples with solutions and examiner commentary

    Practice Questions

    Test your understanding — click to reveal model answers

    Q1

    Construct a truth table for the NOT operator.

    2 marks
    foundation

    Hint: The NOT operator only takes one input.

    Q2

    Complete the truth table for the expression: X = A OR (NOT B)

    3 marks
    standard

    Hint: Add an intermediate column for NOT B first.

    Q3

    A logic circuit has three inputs: P, Q, and R. The output Z is true if P is true AND Q is true, OR if R is true. Construct the truth table for this circuit.

    5 marks
    challenging

    Hint: The expression is Z = (P AND Q) OR R. You will need 8 rows.

    Q4

    Explain why a logic circuit with 4 inputs requires a truth table with 16 rows.

    2 marks
    standard

    Hint: Think about the formula for calculating rows.

    Q5

    A student constructs a truth table for A AND B. They write the output column as: 1, 0, 0, 0. Identify the error they have made.

    2 marks
    standard

    Hint: Look at the standard input pattern for A and B.

    Key Terms

    Essential vocabulary to know