Computer Science (4CP0)
Topic 8 of 12Pearson EdExcel

Boolean Logic and Logic Gates

AND, OR, NOT, NAND, NOR, XOR gates and truth tables for digital circuits.

Stage 1: Topic Introduction Video

Start the topic with a quick definition, relevance, and learning outcomes before entering the full lesson body.

Introduction

30-60 sec

Hook the learner with a simple definition, relevance, and learning outcomes.

Placed at the beginning of the topic journey.

Dry-run assets generated

Written lesson and quiz remain available while this stage video is being prepared.

Branding: seekhoasaan-default-2026Narration: neutral-friendly-urdu-englishSubtitles: burned-in-dual-language

**1. Digital Logic — The Language Computers Actually Speak**


Every computer, from the traffic light controllers on Karachi's II Chundrigar Road to SUPARCO's satellite systems, thinks in binary — just 1s and 0s. Boolean logic is the mathematics of these binary decisions.


George Boole (1815-1864) invented this system. Every digital circuit in every device uses Boolean logic — it is the foundation of computing.


Boolean values: TRUE (1) or FALSE (0). That's it. Every complex computation — from rendering a PSL live stream to processing a JazzCash transaction — breaks down into millions of simple TRUE/FALSE decisions.


**2. The Basic Logic Gates**


A logic gate takes one or more binary inputs and produces one binary output.


NOT gate (inverter):

  • 1 input, 1 output
  • Flips the input: 0→1, 1→0
  • Expression: `Q = NOT A` or `Q = Ā`

| A | Q |

|---|---|

| 0 | 1 |

| 1 | 0 |


AND gate:

  • 2+ inputs, 1 output
  • Output is 1 ONLY when ALL inputs are 1
  • Expression: `Q = A AND B`
  • Think: "You need your CNIC AND your photo AND your fingerprint to get a passport"

| A | B | Q |

|---|---|---|

| 0 | 0 | 0 |

| 0 | 1 | 0 |

| 1 | 0 | 0 |

| 1 | 1 | 1 |


OR gate:

  • 2+ inputs, 1 output
  • Output is 1 when ANY input is 1
  • Expression: `Q = A OR B`
  • Think: "You can pay with cash OR JazzCash OR card — any one works"

| A | B | Q |

|---|---|---|

| 0 | 0 | 0 |

| 0 | 1 | 1 |

| 1 | 0 | 1 |

| 1 | 1 | 1 |

Stage 2: Mid-Lesson Concept Video

Inserted into lesson flow using deterministic content sectioning (split by nearest heading).

Concept Breakdown

60-120 sec

Teach the core concept step-by-step with at least one worked explanation.

Placed in the middle of the lesson flow.

Dry-run assets generated

Written lesson and quiz remain available while this stage video is being prepared.

Branding: seekhoasaan-default-2026Narration: neutral-friendly-urdu-englishSubtitles: burned-in-dual-language

**3. Combined Gates**


NAND gate (NOT AND):

  • Output is the opposite of AND
  • `Q = NOT (A AND B)`
  • Output is 0 ONLY when both inputs are 1

NOR gate (NOT OR):

  • Output is the opposite of OR
  • `Q = NOT (A OR B)`
  • Output is 1 ONLY when both inputs are 0

XOR gate (Exclusive OR):

  • Output is 1 when inputs are DIFFERENT
  • `Q = A XOR B`
  • Think: "Either biryani OR nihari, but not both — exclusive choice"

| A | B | XOR |

|---|---|---|

| 0 | 0 | 0 |

| 0 | 1 | 1 |

| 1 | 0 | 1 |

| 1 | 1 | 0 |


**4. Building Logic Circuits**


Logic gates combine to make useful circuits. To solve a logic circuit problem:


  1. Identify all gates and their connections
  2. Work from inputs to output, calculating intermediate values
  3. Build the truth table row by row for all input combinations

Example: A burglar alarm system. Sensor A detects door open, Sensor B detects window open. Alarm should ring if EITHER is triggered AND the system is armed (C = 1).


Circuit: `Q = (A OR B) AND C`


If door opens (A=1) while system armed (C=1): (1 OR 0) AND 1 = 1 AND 1 = 1 → alarm rings.


Writing Boolean expressions from circuits:

  • Read the circuit diagram left to right
  • Note each gate's operation
  • Combine into a single expression
  • Simplify if possible

**5. Exam Strategy**


  • Always draw truth tables with ALL possible input combinations (2 inputs = 4 rows, 3 inputs = 8 rows).
  • For 3-input tables: list inputs systematically (000, 001, 010, 011, 100, 101, 110, 111).
  • Work through combined circuits step by step — label intermediate outputs.
  • Recognise gate symbols instantly — practise drawing them from memory.
  • XOR is the one students forget — "different = 1, same = 0".
  • NAND is called the "universal gate" because you can build ANY other gate from just NAND gates.

Key Points to Remember

  • 1NOT inverts (0→1, 1→0); AND needs all 1s; OR needs any 1
  • 2NAND = NOT AND; NOR = NOT OR; XOR = 1 when inputs differ
  • 3Truth tables: 2 inputs = 4 rows, 3 inputs = 8 rows — list systematically
  • 4Combine gates left-to-right, calculate intermediate outputs step by step
  • 5NAND is the universal gate — any circuit can be built from NANDs alone

Pakistan Example

JazzCash Transaction Validation — Logic in Action

When you send money via a mobile wallet, the system checks: valid PIN (A) AND sufficient balance (B) AND active SIM (C). All three must be TRUE for the transaction to proceed — a real-world AND gate with 3 inputs. If any condition is FALSE, the transaction is blocked. These Boolean checks happen constantly in real systems.

Quick Revision Infographic

Computer Science — Quick Revision

Boolean Logic and Logic Gates

Key Concepts

1NOT inverts (0→1, 1→0); AND needs all 1s; OR needs any 1
2NAND = NOT AND; NOR = NOT OR; XOR = 1 when inputs differ
3Truth tables: 2 inputs = 4 rows, 3 inputs = 8 rows — list systematically
4Combine gates left-to-right, calculate intermediate outputs step by step
5NAND is the universal gate — any circuit can be built from NANDs alone

Formulas to Know

NOT inverts (0→1, 1→0); AND needs all 1s; OR needs any 1
AND = NOT AND; NOR = NOT OR; XOR = 1 when inputs differ
Truth tables: 2 inputs = 4 rows, 3 inputs = 8 rows — list systematically
Pakistan Example

JazzCash Transaction Validation — Logic in Action

When you send money via a mobile wallet, the system checks: valid PIN (A) AND sufficient balance (B) AND active SIM (C). All three must be TRUE for the transaction to proceed — a real-world AND gate with 3 inputs. If any condition is FALSE, the transaction is blocked. These Boolean checks happen constantly in real systems.

SeekhoAsaan.com — Free RevisionBoolean Logic and Logic Gates Infographic

Stage 3: End-of-Topic Summary Video

End the topic with a concise recap of key takeaways, formulas, and revision reminders.

Summary

30-60 sec

Provide a concise revision recap with key formulas/definitions and next steps.

Placed near the end of the topic journey.

Dry-run assets generated

Written lesson and quiz remain available while this stage video is being prepared.

Branding: seekhoasaan-default-2026Narration: neutral-friendly-urdu-englishSubtitles: burned-in-dual-language

Test Your Knowledge!

6 questions to test your understanding.

Start Quiz