Logic gate truth table generator
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̅
| A | B | C | A AND B | NOT C | Q = (A AND B) OR NOT C |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
Working
- 3 inputs (A, B, C) give 2³ = 8 rows. List them by counting up in binary from 000 to 111.
- Column 1: A AND B. AND gives 1 only when both inputs are 1.
- Column 2: NOT C. NOT flips its input: 1 becomes 0 and 0 becomes 1.
- Finally Q = (A AND B) OR NOT C. OR gives 1 when at least one input is 1.
- 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
Your mock plan, in three taps
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.
More free tools
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
- Inputs are listed by counting up in binary, so n inputs give 2ⁿ rows.
- Brackets are worked first; without brackets NOT is done first, then AND, then XOR, then OR.
- Each gate gets its own column, inner gates first, so the last column is the output.
- AND gives 1 only when both inputs are 1; OR when at least one is; XOR when exactly one is; NOT flips its input.