IB Computer Science HL · Year 2 · Lesson 32

Logic gates, truth tables, Karnaugh maps and logic diagrams

Move fluently between Boolean meaning, truth tables, gate diagrams and simplified expressions.

Paper 150 minutesA1.2.3 · A1.2.4 · A1.2.5
Targets

Boolean logic is representation + reasoning

2 / 11
  • describe AND, OR, NOT, NAND, NOR, XOR and XNOR and their role in binary computing;
  • construct and analyse truth tables from expressions, circuits and problem descriptions;
  • simplify a three-variable result with a Karnaugh map;
  • construct logic diagrams using standard gate symbols and simplify expressions/diagrams when appropriate.
A1.2.3A1.2.4A1.2.5
Assessment boundaryPrepare full truth tables up to three inputs and Karnaugh maps up to three variables. If algebraic laws such as De Morgan’s laws are required, the laws are supplied in the question.
Learn + retrieve

Rapid Recall Deck

3 / 11

Attempt each card first. If a term is new, flip and study it, then answer it again without looking. Mark only secure recall as “Know it”.

A1.2.3

Standard gates implement binary decisions

4 / 11

Standard-symbol reference

ANDORNOTXORNAND = AND + output bubbleNOR = OR + output bubbleXNOR = XOR + output bubble

Gate selection

Choose the gate for each requirement: (A) output 1 only if both sensors are active; (B) output 1 when exactly one of two switches is active; (C) output the opposite of one input; (D) output 1 when two inputs match.

A → AND. B → XOR. C → NOT. D → XNOR.

A1.2.4 · Construct

Full truth tables are required up to three inputs

5 / 11

Construct a three-input truth table

For F = (A AND B) OR (NOT C), complete all eight input combinations.

ABCA AND BNOT CF
000
001
010
011
100
101
110
111

For rows 000,001,010,011,100,101,110,111: F = 1,0,1,0,1,0,1,1. The intermediate A AND B column is 0,0,0,0,0,0,1,1 and NOT C is 1,0,1,0,1,0,1,0.

Analyse

Translate words into Boolean structure

6 / 11

From problem description to truth table

A secure door opens only when a valid card is present (C=1) AND either the normal-hours signal is active (H=1) OR an administrator override is active (A=1).

1. Write a Boolean expression for output O. 2. State O for inputs C=1, H=0, A=1 and for C=0, H=1, A=1.

O = C AND (H OR A). For 1,0,1 the output is 1. For 0,1,1 the output is 0 because the valid-card condition fails.

Karnaugh maps

Group cells that differ only in variables that can disappear

7 / 11

Three-variable Karnaugh map

F is 1 for minterms 1, 3, 5 and 7. Fill/group this map using columns BC in Gray-code order 00, 01, 11, 10.

A \ BC00011110
00110
10110

What single-variable expression does the group of four 1s simplify to?

The four 1s occur exactly where C=1, while A and B change within the group. Therefore the simplified expression is F = C.

Why simplification matters

Explain one benefit of replacing a more complex Boolean expression with an equivalent simpler expression before implementing a circuit.

A simpler equivalent expression can require fewer gates/connections, reducing hardware complexity, cost, propagation delay or power use while preserving the same truth-table behaviour.

A1.2.5 · Construct

Expression → connected standard gates

8 / 11

Construct the logic diagram

Draw a standard-symbol logic diagram for F = (A XOR B) AND (NOT C). Before drawing, describe the connection order.

Subexpressions — identify which operations must be produced before the final operation.
Intermediate outputs — decide which earlier gate outputs feed a later gate.
Final diagram — use the correct standard symbols and connections.
A ─┐
   XOR ───┐
B ─┘      │
          AND ── F
C ── NOT ─┘

The actual exam diagram should use the standard XOR, NOT and AND gate symbols shown on page 4.

Analyse

Move both directions: circuit ↔ expression ↔ table

9 / 11

Truth table from a circuit

Analyse this circuit: it first computes X = A NAND B, then F = X AND C. Determine F for A=1, B=1, C=1 and for A=1, B=0, C=1, showing the intermediate X value in each case.

For 1,1,1: A NAND B = 0, so F=0. For 1,0,1: A NAND B = 1, so F=1.

Apply a supplied Boolean law

In an exam, any algebraic law needed for this kind of simplification will be supplied. Suppose the question gives:
NOT(A OR B) = (NOT A) AND (NOT B).

Use that supplied law to rewrite NOT(X OR Y). Then state which two gate operations appear in the rewritten expression.

NOT(X OR Y) = (NOT X) AND (NOT Y). The rewritten expression uses NOT on each input and then AND to combine the two results.

The assessment point is to apply a supplied law correctly; students are not expected to memorize an unprovided algebraic law for this purpose.

Exam lens

Construct, then check equivalence

10 / 11

Paper 1-style mini-set

1. Construct the truth-table output column for F = A XOR B.

2. Describe the role of logic gates in binary computing.

3. Construct a logic diagram for F = NOT(A OR B) using standard gate symbols.

  1. For AB = 00,01,10,11 the outputs are 0,1,1,0.
  2. Logic gates implement Boolean operations on binary signals and combine them to make hardware decisions/computations inside digital systems.
  3. Feed A and B into an OR gate, then pass the OR output through a NOT gate; equivalently one NOR gate implements the same function.
Homework

Finish the learning cycle

11 / 11

IA — main task

Continue Criterion D development/testing. Keep one concise record of what you changed, why and how you verified it.

Paper 1 — short practice

Construct one three-input truth table, one three-variable Karnaugh simplification and two standard-symbol logic diagrams without revealing the models.

Checkpoint

Use the 2027 Case Study Hub for a 5–10 minute research checkpoint: record one way large-scale generative-image computation depends on efficient digital hardware.