📘 Paper 2 · Topic 9: Boolean Logic
9.2 Logic Expressions and Circuit Diagrams
Cambridge IGCSE Computer Science 0478 · ~16 min read · ⭐ Pro

Logic Expressions

A logic expression is a combination of Boolean variables and operators (AND, OR, NOT) that produces a TRUE or FALSE output. Logic expressions can be evaluated using truth tables, and can be represented as logic circuit diagrams.

Writing Logic Expressions

Boolean algebra uses standard notation:

OperatorSymbolCambridge notation
AND· or ∧A AND B
OR+ or ∨A OR B
NOT¬ or Ā (overline)NOT A

Evaluating Logic Expressions

Example 1: Q = (A AND B) OR (NOT C)

With A=1, B=0, C=1: A AND B = 1 AND 0 = 0; NOT C = NOT 1 = 0; Q = 0 OR 0 = 0

With A=1, B=1, C=1: A AND B = 1; NOT C = 0; Q = 1 OR 0 = 1

Example 2: Full truth table for X = (A OR B) AND (NOT A)

ABA OR BNOT AX = (A OR B) AND (NOT A)
00010
01111
10100
11100

Logic Circuits

A logic circuit diagram shows gates connected together with wires. The output of one gate can feed into another gate's input.

Reading a circuit diagram

To evaluate a circuit for given inputs:

  • Work from left to right
  • Evaluate each gate in sequence
  • Label intermediate outputs (P, Q, etc.)
  • The final gate's output is the circuit output

Example: 3-input circuit

A ──┐
    AND → P ──┐
B ──┘         OR → X
C ────────────┘

To evaluate: First find P = A AND B, then find X = P OR C.

Example truth table for the above circuit (Q = (A AND B) OR C)

ABCP = A AND BX = P OR C
00000
00101
01000
01101
10000
10101
11011
11111

Order of Evaluation (Precedence)

When no brackets are given, the order is: NOT first, then AND, then OR. Brackets override this order (evaluate innermost brackets first).

NOT A AND B OR C  →  ((NOT A) AND B) OR C
A OR B AND C      →  A OR (B AND C)
Exam tip: When completing a truth table for 3 variables, you need 8 rows (2³=8). Write inputs systematically: A: 0,0,0,0,1,1,1,1 | B: 0,0,1,1,0,0,1,1 | C: 0,1,0,1,0,1,0,1. For a logic circuit, always add intermediate columns (one per gate) to show your working — marks are given for each step.
⚠️ Common Mistakes
  • Wrong number of rows — 2 variables → 4 rows; 3 variables → 8 rows; 4 variables → 16 rows
  • Evaluating in wrong order without brackets — NOT before AND before OR
  • Missing intermediate columns in truth table — always show P, Q etc. as intermediate steps
  • Forgetting that NOT applies only to the immediately following variable (unless bracketed)
Video coming soon
Click slide or press arrow keys to navigate
✍️

Worksheet — Logic Expressions

4 questions · 12 marks

Q1Evaluate Q = (NOT A) AND B with A=1, B=1. Show your working. [2]
✅ Mark scheme
NOT A = NOT 1 = 0 [1]; (NOT A) AND B = 0 AND 1 = 0 [1]. Q = 0.
Q2Complete the truth table for Q = A AND (B OR C). Show the intermediate column B OR C. [5]
✅ Mark scheme
B OR C column: 0,1,1,1,0,1,1,1 [2]; Q = A AND (B OR C): 0,0,0,0,0,1,1,1 [3] — Q=1 only in rows where A=1 AND (B OR C)=1
Q3Write the logic expression for: "The output is 1 if A is 1 and B is 0, OR if C is 1." [2]
✅ Mark scheme
X = (A AND NOT B) OR C [2] (1 mark for A AND NOT B; 1 mark for OR C)
Q4State the order of precedence for Boolean operators (highest to lowest). [3]
✅ Mark scheme
1. Brackets (parentheses) — highest priority [1]; 2. NOT [1]; 3. AND; 4. OR — lowest priority [1]
Quiz — Logic Expressions
Q 1 of 7
Score
/ 7
Click to reveal
TermDefinition
🎯

Mini Test — Logic Expressions

10 minutes · mixed marks

← 9.1 Boolean Logic Topic 9: Boolean Logic Next: 10.1a Pseudocode →
🔒
Pro Content
Upgrade to access all lessons.
£7.99/month
or £59/year
Subscribe now →