FREE TOOL · IGCSE AND A LEVEL

Truth Table Generator and Logic Circuit Drawer

Type any logic expression and get its truth table, the working columns for each part, and the logic circuit drawn with the correct gate symbols. It works with AND, OR, NOT, NAND, NOR and XOR and up to four inputs.

Examples:

Truth table

Logic circuit

Use the inputs A, B, C and D with AND, OR, NOT, NAND, NOR and XOR. Use brackets to show the order. NOT is applied first, then AND/NAND, then XOR, then OR/NOR. In the exam, a truth table with 3 inputs always has 8 rows: count up in binary from 000 to 111.

How to complete a truth table

List every combination of inputs by counting up in binary: 2 inputs give 4 rows, 3 inputs give 8 rows and 4 inputs give 16 rows. Then work out each part of the expression in its own column, and use those columns to find the final output X.

The logic gates

  • AND: 1 only when both inputs are 1.
  • OR: 1 when at least one input is 1.
  • NOT: reverses the input.
  • NAND: the opposite of AND, so 0 only when both inputs are 1.
  • NOR: the opposite of OR, so 1 only when both inputs are 0.
  • XOR: 1 when the inputs are different.

Worked exam-style example

Question: Complete the truth table for X = (A AND B) OR (NOT C). [4 marks]

Three inputs give 23 = 8 rows. Count up in binary for A, B and C, work out A AND B and NOT C in their own columns, then OR those two columns to get X.

ABCA AND BNOT CX
000011
001000
010011
011000
100011
101000
110111
111101

X is 0 only when C is 1 and A AND B is 0. Type (A AND B) OR (NOT C) into the generator above to check the table and see the circuit.

Exam tips

  • Draw the gate symbols exactly: examiners do not accept boxes with labels.
  • Use working columns. Partly correct tables can still score marks.
  • Read the question carefully: a scenario like “the alarm sounds if the door is open AND the system is on” turns straight into an expression.

Revise the full topic: IGCSE Boolean logic · A Level logic gates and circuits

Frequently asked questions

How many rows are in a truth table with 3 inputs?

Eight rows, because 2 × 2 × 2 = 8 combinations of 0s and 1s.

What gates does the truth table generator support?

NOT, AND, OR, NAND, NOR and XOR, the six gates used in IGCSE 0478 and A Level 9618.

How should I write a logic expression?

Use the gate names in capitals and brackets to show the order, for example X = (A AND B) OR NOT C.

More free tools: Binary, denary and hex converter · SQL practice playground · All tools