CE2704 · Digital Logic Design
Theme 2 · Boolean algebra & logic gates

Truth tables

The complete, unambiguous way to describe what a logic circuit does — every input combination, every output. The bridge from a requirement to a circuit.

Built from first principles.

Before you start

What you need first

  • Boolean basics & gates — the AND/OR/NOT operators and their own little truth tables.

What you'll be able to do

  • Build a truth table with the right number of rows (2ⁿ).
  • Turn an English requirement into a truth table.
  • Recognise a function (AND, XNOR…) from its table.

The universal specification tool

A truth table lists every possible combination of inputs and the output for each. It is the most unambiguous way to say what a circuit does.

  • For n inputs, the table has \(2^n\) rows: 1 input → 2, 2 → 4, 3 → 8, 4 → 16, 8 → 256.
  • List the inputs in binary counting order (000, 001, 010…) so you never miss a case.
Why your future boss loves them: a truth table forces you to think about every input combination — including the ones you didn't expect. Many safety bugs came from one forgotten row.

Building a table from a requirement

📐 Worked example

"A pump runs when the tank is LOW, but only if the system is ENABLED."

Inputs: E = enabled (1), L = level low (1). Output: P = pump runs (1). Reason through all four rows:

ELPWhy
000off — never run
010off — never run, even if low
100enabled, tank fine — don't run
111enabled and low — run
$$ P = E \cdot L $$
This table is identical to the AND table — the pump circuit is literally one AND gate.

A three-input example: parity

Specification: "Output 1 when an odd number of the three inputs is 1." Three inputs → \(2^3 = 8\) rows. Just count the 1s in each row:

ABC#1sF
00000
00111
01011
01120
10011
10120
11020
11131
🔭 Looking ahead: each F=1 row becomes one AND term, OR-ed together — that's the canonical form you'll formalise in Theme 3. This "odd count" function is parity, used in error detection.

✏️ Try it yourself

(a) How many rows for a function of 5 inputs? (b) Fill the truth table for F = A·B′. (c) A 2-input gate outputs 1 only when its inputs are equal — which gate?

(a) \(2^5 = 32\) rows. (b) A·B′ = 1 only for A=1,B=0: rows 00→0, 01→0, 10→1, 11→0. (c) the XNOR gate (the equality detector).

Recap — the whole topic on one screen

IdeaWhat you own now
Truth tableEvery input combination + its output
Sizen inputs → \(2^n\) rows; list in binary order
From a specName inputs/output, reason every row, read the function
DisciplineNever skip a row — silent rows are still your design

Next topic

The derived gates: NAND/NOR/XOR/XNOR

AND, OR, NOT are enough to build anything — but four more gates make designs smaller and faster, and two of them can build everything on their own.

→ The derived gates