Skip to the tool

Logic gate truth table generator

Use A, B, C for inputs and AND, OR, NOT, XOR (or . + ⊕ ¬) with brackets.

Truth table

Q = 1 in 5 of 8 rows

Q = (A AND B) OR NOT C uses 1 AND, 1 OR, 1 NOT gates.

In symbols
Q = (A ∧ B) ∨ ¬C
AQA notation
Q = (A . B) + C̅
Truth table for Q = (A AND B) OR NOT C
ABCA AND BNOT CQ = (A AND B) OR NOT C
000011
001000
010011
011000
100011
101000
110111
111101

Working

  1. 3 inputs (A, B, C) give 2³ = 8 rows. List them by counting up in binary from 000 to 111.
  2. Column 1: A AND B. AND gives 1 only when both inputs are 1.
  3. Column 2: NOT C. NOT flips its input: 1 becomes 0 and 0 becomes 1.
  4. Finally Q = (A AND B) OR NOT C. OR gives 1 when at least one input is 1.
  5. Q is 1 in 5 of the 8 rows.

Your result

Q = 1 in 5 of 8 rows. Q = (A AND B) OR NOT C uses 1 AND, 1 OR, 1 NOT gates.

Practise logic gates

GCSE Computer Science Pro

Full refund within 14 days

£49 once

12 months of access

By paying you agree to our Terms and get access straight away, which ends your 14-day cancellation right. Your full refund within 14 days, for any reason, still applies.

No VAT is charged. Terms

Your mock plan, in three taps

Your subject
When do your mocks start?
Hours a week

Q = (A AND B) OR NOT C has 3 inputs, so its truth table has 2³ = 8 rows, and Q is 1 in 5 of them.

Questions people ask

How many rows does a truth table need?

2 to the power of the number of inputs: 2 inputs need 4 rows, 3 inputs need 8 and 4 inputs need 16. List them by counting up in binary from all 0s to all 1s.

What is the difference between OR and XOR?

OR gives 1 when at least one input is 1, including when both are. XOR (exclusive OR) gives 1 only when exactly one input is 1, so 1 XOR 1 is 0. XOR is on AQA's specification but not OCR's.

How do AQA and OCR write logic expressions?

AQA uses a dot for AND, + for OR, ⊕ for XOR and a bar over a letter for NOT, so (A AND B) OR NOT C is A.B + C̅. OCR uses the words AND, OR and NOT, or the symbols ∧, ∨ and ¬.

How do I turn a logic circuit into an expression?

Start at the inputs and name what comes out of each gate in turn: an AND gate fed by A and B gives A AND B. Carry on until you reach the output, adding brackets around each gate's result.

Keep going

How we work this out

What it does

Type a logic expression with AND, OR, NOT and XOR to get its full truth table, working column by column.

Expressions with up to 4 inputs (single letters) and the gates AND, OR, NOT and XOR. GCSE questions use up to 3 inputs.

Method

  1. Inputs are listed by counting up in binary, so n inputs give 2ⁿ rows.
  2. Brackets are worked first; without brackets NOT is done first, then AND, then XOR, then OR.
  3. Each gate gets its own column, inner gates first, so the last column is the output.
  4. AND gives 1 only when both inputs are 1; OR when at least one is; XOR when exactly one is; NOT flips its input.