BETAThis platform is under active development; bugs, missing features, and risk of data loss are present. Thank you for your support!

Boolean Logic

Learn it by playing

Answer these questions to earn energy, then fish and explore. No account needed.

For teachers: ready-to-use lesson slides, revision notes, diagrams for Boolean Logic (Computer Science, CIE) — use them in your lesson, or run the topic as a live class game.

Notes

Boolean Logic Basics

  • **Boolean logic** is used in computer science and electronics to make logical decisions.
  • Boolean values are either **TRUE** or **FALSE**, often represented as **1** or **0**.
  • Inputs and outputs are given **letters** (e.g., A, B, Q).
  • Special symbols are used to write Boolean expressions concisely.

Logic Gates Overview

  • **Logic gates** are visual representations of Boolean expressions.
  • The six gates covered are: **AND**, **OR**, **NOT**, **XOR**, **NAND**, **NOR**.
  • Each gate has a unique **circuit symbol** and **truth table**.
  • Gates can be combined to form **logic circuits**.

AND, OR, NOT Gates

  • **AND**: Output TRUE only if **both** inputs are TRUE. Expression: A AND B.
  • **OR**: Output TRUE if **at least one** input is TRUE. Expression: A OR B.
  • **NOT**: Output is the **opposite** of the input. Expression: NOT A.
  • Truth tables list all input combinations and the corresponding output.

XOR, NAND, NOR Gates

  • **XOR** (exclusive OR): Output TRUE if **exactly one** input is TRUE. Expression: A XOR B.
  • **NAND** (NOT AND): Output FALSE only if **both** inputs are TRUE. Expression: A NAND B.
  • **NOR** (NOT OR): Output TRUE only if **both** inputs are FALSE. Expression: A NOR B.
  • Common exam mistake: confusing OR and XOR. XOR is false when both inputs are TRUE.

Logic Circuits

  • A **logic circuit** performs logical operations using multiple gates.
  • **Logic diagrams** show the arrangement of gates and connections.
  • **Brackets** clarify the order of operations in expressions.
  • Circuits are limited to a maximum of **three inputs** and **one output**.
  • Draw circuits from **left to right**, labelling all inputs clearly.

Truth Tables for Circuits

  • A **truth table** lists all possible inputs and the resulting output.
  • Number of rows = **2n**, where n is the number of inputs.
  • List inputs in **binary order** starting from 000.
  • Add intermediate columns for sub-expressions if needed.
  • The final column shows the output of the whole expression.

Creating Circuits from Truth Tables

  • Identify rows where output = **1**.
  • For each such row, create a **logic branch** using AND and NOT gates.
  • Combine all branches with an **OR gate**.
  • Write the Boolean expression and draw the circuit.
  • Example: (A AND NOT B AND NOT C) OR (A AND B AND C).

Logic Expressions

  • A **logic expression** is an equation: output = function of inputs.
  • Each gate has a standard expression (e.g., Z = A AND B).
  • Complex circuits yield expressions like Q = NOT(A OR B).
  • You may be asked to write an expression from a circuit or truth table, or vice versa.

Simple logic circuit representation (series circuit analogy).

Series circuitInput AOutput Q

Truth table grid analogy (Punnett square style).

Genetic cross: Aa × AaBoolean logic example (not genetic)Parent 1 gametesParent 2 gametesAaAaAAAaAaaaGenotype ratio 1 AA : 2 Aa : 1 aaPhenotype ratio 3 dominant : 1 recessive

Practice questions

Free preview — 8 of 40 questions. Sign up to see them all.

  1. 1.Which logic gate returns TRUE only when both inputs are TRUE?

    Easy
    • AAND
    • BOR
    • CXOR
    • DNAND
  2. 2.What is the output of a NOT gate when the input is 1?

    Easy
    • A0
    • B1
    • CBoth 0 and 1
    • DUndefined
  3. 3.Which of the following truth tables represents an XOR gate?

    Medium
    • AA B Q\n0 0 0\n0 1 1\n1 0 1\n1 1 0
    • BA B Q\n0 0 0\n0 1 1\n1 0 1\n1 1 1
    • CA B Q\n0 0 1\n0 1 1\n1 0 1\n1 1 0
    • DA B Q\n0 0 1\n0 1 0\n1 0 0\n1 1 0
  4. 4.How many rows are needed in a truth table for a logic circuit with three inputs?

    Medium
    • A3
    • B6
    • C8
    • D9
  5. 5.What is the Boolean expression for the logic circuit that has an OR gate with inputs A and B, followed by a NOT gate?

    Hard
    • ANOT(A OR B)
    • BA OR NOT B
    • CNOT A OR B
    • DA NOR B
  6. 6.Which gate is represented by the symbol that looks like an OR gate with a small circle at the output?

    Easy
    • ANOR
    • BNAND
    • CXOR
    • DNOT
  7. 7.For the Boolean expression P = (A AND B) AND NOT C, what is the value of P when A=1, B=1, C=1?

    Medium
    • A0
    • B1
    • CCannot be determined
    • DDepends on the gate
  8. 8.Which of the following Boolean expressions corresponds to the truth table where X=1 only when A=1, B=0, C=0 OR when A=1, B=1, C=1?

    Hard
    • A(A AND NOT B AND NOT C) OR (A AND B AND C)
    • B(A AND B AND C) OR (NOT A AND NOT B AND NOT C)
    • C(A OR B OR C) AND (NOT A OR NOT B OR NOT C)
    • D(A AND B) OR (NOT B AND NOT C)

Unlock all 40 questions, slides & more

Create a free account to see every question, the slides, flashcards and revision notes for this topic.

Past papers

Past-paper practice for this topic is coming soon.

🗂️ Coming soon