10.1 Boolean Logic

Standard Logic Gates

1. The 6 Standard Logic Gates

Each gate has a specific logic rule and a corresponding truth table showing every possible input/output combination.

NOT Gate
NOT Gate
Output is the inverse of the input.
AOUT
01
10
AND Gate
AND Gate
Output is 1 only if BOTH inputs are 1.
ABOUT
000
010
100
111
OR Gate
OR Gate
Output is 1 if AT LEAST ONE input is 1.
ABOUT
000
011
101
111
NAND Gate (NOT AND)
NAND Gate
Output is 0 only if BOTH inputs are 1.
ABOUT
001
011
101
110
NOR Gate (NOT OR)
NOR Gate
Output is 1 only if BOTH inputs are 0.
ABOUT
001
010
100
110
XOR Gate (Exclusive OR)
XOR Gate
Output is 1 if inputs are DIFFERENT.
ABOUT
000
011
101
110

2. Logic Algebra Symbols

In exams, you may see logic represented as equations:

  • AND: $A \cdot B$ or $A \text{ AND } B$
  • OR: $A + B$ or $A \text{ OR } B$
  • NOT: $\bar{A}$ or $\text{NOT } A$
⚠️ Exam Note: When drawing a logic circuit from an expression like $X = (\text{A AND B}) \text{ OR (NOT C)}$, always work from the inside of the brackets outwards.

Logic in Real-Life

1. Sensors as Logic Inputs

In automated systems, sensors provide the binary input (0 or 1) based on a threshold value. For example:

Temperature:
1 = Too Hot
0 = Normal
Pressure:
1 = Pressed
0 = Not Pressed
Light:
1 = Dark
0 = Bright
Switch:
1 = Closed (On)
0 = Open (Off)

2. Worked Scenario: The Safety Alarm

The Problem: A chemical plant needs an alarm (X) to sound if:
  • The Temperature (T) is too high (T=1) AND the Pressure (P) is too high (P=1).
  • OR if the Emergency Switch (S) is pressed (S=1).

Step 1: Map the Logic

IF (T=1 AND P=1) OR (S=1) THEN X=1

Step 2: Create the Expression

X = (T AND P) OR S

Step 3: The Truth Table

This table shows when the alarm will actually sound based on the sensors:

T P S X (Alarm)
0000
0011 (Switch pressed)
1101 (Temp & Press high)
1111 (All triggered)

3. Common Real-Life Examples

  • Street Lighting: Light Sensor (Dark) AND Timer (On) ➔ Lamp On.
  • Bank Vault: Key 1 (Turned) AND Key 2 (Turned) ➔ Door Opens.
  • Microwave: Timer (Not 0) AND Door (Closed) ➔ Start Cooking.
⚠️ Exam Note: Always read the "Conditions" carefully. Sometimes an exam will say "Alarm sounds if the window is NOT closed." If Closed = 1, you must use a NOT gate on that input.

Logic Expressions

1. Understanding the Syntax

In IGCSE, expressions can be written in two ways. You must be comfortable with both:

  • Textual: $X = (\text{A AND B}) \text{ OR (NOT C)}$
  • Symbolic: $X = (A \cdot B) + \bar{C}$

2. Worked Example: Building a Truth Table

Scenario: Create a truth table for the expression:

X = (A AND B) OR (NOT C)

Step-by-Step Breakdown

1 Identify Inputs: There are 3 inputs (A, B, C). This means there are $2^3 = 8$ possible combinations.
2 Create Intermediate Columns: Solve the brackets first. Create a column for (A AND B) and another for (NOT C).
3 Final Output: Use the OR gate to combine the two intermediate columns.

The Resulting Truth Table

A B C A AND B NOT C X
000011
001000
010011
011000
100011
101000
110111
111101

3. Common Logic Gates Combinations

  • NAND Logic: $\text{NOT (A AND B)}$ is the same as saying "Output 0 only when A and B are 1".
  • NOR Logic: $\text{NOT (A OR B)}$ is the same as saying "Output 1 only when A and B are both 0".
⚠️ Exam Tip: Always use Intermediate Columns. Even if the question doesn't ask for them, drawing them on your scrap paper prevents simple logic errors that ruin the entire final output column.