Boolean Logic (Copy)
1. Standard Symbols for Logic Gates
In digital electronics, logic gates are electronic devices that perform basic logical functions using binary input (0 or 1). Each gate has a standard circuit symbol used in diagrams.
Binary Logic Recap:
- 0 = LOW / FALSE
- 1 = HIGH / TRUE
Standard Gate Symbols (two-input unless specified):
- NOT gate (Inverter) – Triangle with a small circle at the output
- AND gate – D-shaped symbol with two input lines, one output line
- OR gate – Curved front with two inputs converging into one output
- NAND gate – AND gate symbol + small circle at output
- NOR gate – OR gate symbol + small circle at output
- XOR (Exclusive OR, EOR) – OR gate shape with an extra curved line before inputs
NOTE:
- NOT has 1 input
- All others are limited to 2 inputs in the syllabus
2. Functions of Logic Gates
NOT Gate
- Symbol: Triangle + small circle
- Inputs: 1
- Function: Outputs the opposite (logical inversion) of input
- Logic Expression: Q = ¬A or Q = NOT A
- Truth Table:
| A | Q |
|---|---|
| 0 | 1 |
| 1 | 0 |
AND Gate
- Symbol: D-shape
- Inputs: 2
- Function: Outputs 1 only when both inputs are 1
- Logic Expression: Q = A â‹… B or Q = A AND B
- Truth Table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR Gate
- Symbol: Curved shape
- Inputs: 2
- Function: Outputs 1 if any one input is 1
- Logic Expression: Q = A + B or Q = A OR B
- Truth Table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NAND Gate
- Symbol: AND gate + small circle
- Inputs: 2
- Function: Outputs the opposite of AND gate result
- Logic Expression: Q = ¬(A ⋅ B) or Q = NOT (A AND B)
- Truth Table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
NOR Gate
- Symbol: OR gate + small circle
- Inputs: 2
- Function: Outputs the opposite of OR gate result
- Logic Expression: Q = ¬(A + B) or Q = NOT (A OR B)
- Truth Table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
XOR (Exclusive OR, EOR) Gate
- Symbol: OR gate + extra curve on input side
- Inputs: 2
- Function: Outputs 1 if inputs are different; outputs 0 if inputs are same
- Logic Expression: Q = (A ⋅ ¬B) + (¬A ⋅ B)
- Truth Table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
3. Creating Logic Circuits
We can create circuits from:
- Problem Statement – Text describing desired behaviour
- Logic Expression – e.g., Q = A AND (NOT B)
- Truth Table – List of inputs/outputs
Example from problem statement:
“The alarm should sound if the door is open AND the window is open.”
- Inputs: A = Door open, B = Window open
- Output: Q = Alarm
- Logic: Q = A â‹… B (AND gate)
Example from logic expression:
Q = ¬A + B
- Step 1: Draw NOT gate for A
- Step 2: Connect NOT output and B into OR gate
Example from truth table:
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
From analysis:
- Output is 1 when B = 1, so Q = B
- No gate needed except a direct connection (simplest form)
4. Completing Truth Tables
You can generate output from:
- Problem Statement – Interpret condition, test all combinations of inputs
- Logic Expression – Apply Boolean rules to each row of inputs
- Logic Circuit – Follow inputs through gates step-by-step
Example: For Q = (A ⋅ B) + ¬C
| A | B | C | A⋅B | ¬C | Q |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 1 |
5. Writing Logic Expressions
From:
- Problem Statement – Identify logical relationships
- Logic Circuit – Read from inputs to output
- Truth Table – Use Sum of Products (SoP) method:
- Write expression for each row where output is 1
- OR them together
Example:
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Rows where Q = 1:
- Row 2: ¬A ⋅ B
- Row 3: A ⋅ ¬B
So, Q = (¬A ⋅ B) + (A ⋅ ¬B) → XOR
6. Truth Table with Three Inputs Example
| A | B | C | Output |
|---|---|---|---|
| 0 | 0 | 0 | ? |
| 0 | 0 | 1 | ? |
| 0 | 1 | 0 | ? |
| 0 | 1 | 1 | ? |
| 1 | 0 | 0 | ? |
| 1 | 0 | 1 | ? |
| 1 | 1 | 0 | ? |
| 1 | 1 | 1 | ? |
For each row, substitute A, B, C into the logic expression.
7. Key Syllabus Rules
- Maximum three inputs in any circuit
- Only one output per circuit
- No simplification required in exams — draw exactly as described
- Two-input gates only (except NOT)
- NOT has one input
