# Boolean Expressions & Circuit Simplification

- **Track:** Cambridge IGCSE™ Computer Science (0478 / 0984) (CAMBRIDGE IGCSE 0478)
- **Module:** Section 10: Boolean Logic & Gate Circuits
- **Estimated Duration:** 10 minutes
- **Access:** Open Theory (All-Access for Interactive IDE &amp; Autotests)

---

## Theory & Conceptual Background

Translate the conditions before choosing gate symbols. Decide exactly what each input means and whether a 1 means that condition is true.

## Worked rule

A lamp turns on only when it is dark AND either movement is detected OR a manual override is active. Let D mean dark, M mean motion and O mean override. The expression is `D AND (M OR O)`. Draw an OR for M,O feeding an AND with D. If D=0, the lamp remains off even if O=1.

## Truth table to rule

If an output is 1 for A=0,B=1 and A=1,B=0 only, it describes XOR: exactly one input is 1. Check all four rows rather than matching one favourable example.

## Independent construction

An alarm sounds if a door is open AND the system is armed, except when maintenance mode is active. Define three inputs, write an expression, draw its circuit and complete all eight truth-table rows. Compare with `(Door AND Armed) AND NOT Maintenance`. A maintenance input of 1 must suppress the output for every other input combination.

Use the requested gates and statement structure. Algebraic simplification and De Morgan identities are optional extension; they are not substitutes for drawing the specified circuit.

---

## Interactive Exercises & Autotest Specifications

### Exercise 1: Application: Build a circuit (Fill in blank, 30 XP)

**Instructions:**
Work out each answer before submitting. Alarm = (Door AND Armed) AND NOT Maintenance. With Door=1, Armed=1, Maintenance=0, Alarm is: With Door=1, Armed=1, Maintenance=1, Alarm is: Which gate inverts Maintenance?


**Starter Code:**
```text
{"prompt":"Application: Build a circuit","template":"1. Alarm = (Door AND Armed) AND NOT Maintenance. With Door=1, Armed=1, Maintenance=0, Alarm is: [blank_1]\n2. With Door=1, Armed=1, Maintenance=1, Alarm is: [blank_2]\n3. Which gate inverts Maintenance? [blank_3]","blanks":[{"id":"blank_1"},{"id":"blank_2"},{"id":"blank_3"}],"word_bank":["0","1","NOT","AND","OR"]}
```


### Exercise 2: Application: Read output rows (Fill in blank, 30 XP)

**Instructions:**
Work out each answer before submitting. A two-input output is 1 only for inputs 0,1 and 1,0. Which gate matches? Output is 1 only for inputs 0,0. Which gate matches? Output is 1 only for inputs 1,1. Which gate matches?


**Starter Code:**
```text
{"prompt":"Application: Read output rows","template":"1. A two-input output is 1 only for inputs 0,1 and 1,0. Which gate matches? [blank_1]\n2. Output is 1 only for inputs 0,0. Which gate matches? [blank_2]\n3. Output is 1 only for inputs 1,1. Which gate matches? [blank_3]","blanks":[{"id":"blank_1"},{"id":"blank_2"},{"id":"blank_3"}],"word_bank":["XOR","NOR","AND","NAND","OR","NOT"]}
```


### Exercise 3: Independent Practice: A control rule (Fill in blank, 30 XP)

**Instructions:**
Work out each answer before submitting. A lamp is on when Dark is 1 AND either Motion OR Override is 1. Output for Dark=0,Motion=1,Override=1: Output for Dark=1,Motion=0,Override=1: Output for Dark=1,Motion=0,Override=0:


**Starter Code:**
```text
{"prompt":"Independent Practice: A control rule","template":"1. A lamp is on when Dark is 1 AND either Motion OR Override is 1. Output for Dark=0,Motion=1,Override=1: [blank_1]\n2. Output for Dark=1,Motion=0,Override=1: [blank_2]\n3. Output for Dark=1,Motion=0,Override=0: [blank_3]","blanks":[{"id":"blank_1"},{"id":"blank_2"},{"id":"blank_3"}],"word_bank":["0","1"]}
```


