Join the waiting list

IGCSE Computer Science · Tool

Logic and truth tables

How do you complete a truth table for a logic circuit?

List every combination of the inputs (2 inputs give 4 rows, 3 inputs give 8), then work out each gate’s output in turn, with a column for each. AND outputs 1 only when both inputs are 1, OR when at least one is, XOR when exactly one is, and NOT inverts its input.

Q = (A AND B) OR NOT C

ABCANDNOTORQ = 1

Truth table · your row is highlighted

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

A AND B is 1, so the OR gate gives 1 whatever C is.

Free to use here, with no account.

What to take away

  • A truth table lists every combination of inputs: 2ⁿ rows for n inputs.
  • AND outputs 1 only if both inputs are 1; OR if at least one is; XOR if exactly one is.
  • NAND and NOR give the opposite output to AND and OR.

Common mistakes

  • Confusing OR with XOR when both inputs are 1: OR gives 1, XOR gives 0.
  • Leaving out input combinations: three inputs need all 8 rows.

Put Logic and truth tables on your own site

Free for teachers, schools and anyone writing about IGCSE Computer Science. Paste this code where you want it: the tool runs in your page, with a line under it saying where it’s from.

<iframe src="https://www.conceptorbit.com/embed/logic" title="Logic and truth tables: a ConceptOrbit tool" width="100%" height="1020" style="border:0;max-width:960px" loading="lazy"></iframe>
<p><a href="https://www.conceptorbit.com/computer-science/tools/logic">Logic and truth tables</a>, a free IGCSE Computer Science tool from <a href="https://www.conceptorbit.com">ConceptOrbit</a>.</p>

Questions

How do you complete a truth table for a logic circuit?

List every combination of the inputs (2 inputs give 4 rows, 3 inputs give 8), then work out each gate’s output in turn, with a column for each. AND outputs 1 only when both inputs are 1, OR when at least one is, XOR when exactly one is, and NOT inverts its input.

How many rows does a truth table with three inputs need?

Eight, one for each combination of three inputs that can each be 0 or 1: 2 × 2 × 2 = 8.

Is the logic simulator free?

Yes. It runs here in your browser with no account, and every ConceptOrbit course tool is free.