Every decision a computer makes — every "if this, then that" — comes down to two values: TRUE or FALSE. Boolean Logic is the algebra of these two values. This chapter covers truth tables, the basic and derived logic gates, the postulates and theorems of Boolean algebra, DeMorgan's Theorems, and how to draw logic circuits for Boolean expressions.
Build a truth table for every law and gate yourself instead of only memorising it. Pay particular attention to DeMorgan's Theorems, Basic Logic Gates and Boolean Law simplification during revision.
3.1 📜 Development of Boolean Logic
Boolean Logic (also called Boolean Algebra) was developed by the mathematician George Boole in the 1850s — a system of logic using only TWO values: TRUE (1) and FALSE (0).
graph LR
BOOLE["👨🔬 George Boole\n(1854)\n'An Investigation of\nthe Laws of Thought'"]
ALGEBRA["🧮 Boolean Algebra\n(Mathematical logic\nsystem)"]
COMPUTERS["💻 Modern Computers\n(Built on TRUE/FALSE\ncircuit logic!)"]
BOOLE --> ALGEBRA --> COMPUTERS
style BOOLE fill:#9C27B0,color:#fff
style COMPUTERS fill:#4CAF50,color:#fff
Why does this matter for computers? Remember from Chapter 1 — computers are just millions of switches, each either ON or OFF. Boolean Logic gives us the MATHEMATICAL RULES to combine and simplify these ON/OFF (TRUE/FALSE) values — this is literally how ALL digital circuits and computer decision-making work!
| Fact | Detail |
|---|---|
| Developed by | George Boole |
| Published in | 1854, in his book "An Investigation of the Laws of Thought" |
| Core Idea | Logic can be expressed using only two values and mathematical operations |
| Modern Use | Foundation of digital circuits, programming conditions, database queries |
3.2 🔢 Binary Valued Quantities
A Binary Valued Quantity is any variable that can hold ONLY ONE of TWO possible values.
graph LR
T["✅ TRUE\n1\nHIGH\nYES\nON"]
F["❌ FALSE\n0\nLOW\nNO\nOFF"]
style T fill:#4CAF50,color:#fff
style F fill:#F44336,color:#fff
TRUE / 1
Represents an affirmative, ON, or HIGH state
Light switch ONcondition satisfiedFALSE / 0
Represents a negative, OFF, or LOW state
Light switch OFFcondition not satisfiedReal-World Examples of Binary Values:
| Real-World Example | TRUE (1) | FALSE (0) |
|---|---|---|
| Light Switch | ON | OFF |
| Door | Open | Closed |
| Exam Result | Pass | Fail |
| Login Status | Logged In | Logged Out |
"What is a Binary Valued Quantity?" — 1-mark question! Answer: A variable that can take only ONE of TWO possible values — typically represented as TRUE/FALSE or 1/0.
3.3 🔧 Logical Operations
3.3.1 Logical Function or Compound Statement 📝
A Logical Function (or Compound Statement) is an expression formed by combining ONE OR MORE Boolean variables using logical operators, producing a TRUE or FALSE result.
Example: Y = A AND B
Here, Y is the logical function, A and B are Boolean variables,
and AND is the logical operator combining them.
Analogy: Think of a logical function like a RECIPE. The ingredients (A, B) go IN, an operation (AND/OR/NOT) is applied, and a single RESULT (TRUE or FALSE) comes OUT!
3.3.2 Logical Operators 🔧
The THREE fundamental logical operators form the foundation of ALL Boolean logic:
graph TD
OPS["🔧 LOGICAL OPERATORS"]
NOT["🚫 NOT\n(Inverts the value)"]
AND["✖️ AND\n(TRUE only if BOTH true)"]
OR["➕ OR\n(TRUE if AT LEAST ONE true)"]
OPS --> NOT
OPS --> AND
OPS --> OR
style NOT fill:#F44336,color:#fff
style AND fill:#2196F3,color:#fff
style OR fill:#4CAF50,color:#fff
NOT (¬ or ')
Reverses/inverts a single value
NOT TRUE = FALSEAND (·)
TRUE only when BOTH inputs are TRUE
"I'll go out AND it's sunny" — both conditions must holdOR (+)
TRUE when AT LEAST ONE input is TRUE
"I'll eat pizza OR pasta" — either one satisfies itSymbols Used in Boolean Expressions:
| Operator | Common Symbols |
|---|---|
| AND | · or ∧ or simply juxtaposition (AB) |
| OR | + or ∨ |
| NOT | ¬ or ' (apostrophe) or a bar over the variable (Ā) |
"Name the three basic logical operators." — 1-mark question! Answer: AND, OR, NOT
3.3.3 Evaluation of Boolean Expressions using Truth Table 📊
A Truth Table lists ALL possible combinations of input values and the corresponding output result — the ultimate "cheat sheet" for any Boolean expression!
Truth Table for AND:
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Truth Table for OR:
| A | B | A OR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Truth Table for NOT:
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
Memory Trick! 🎵 AND = Strict Boss — needs EVERYONE to say yes. OR = Easy-going friend — just needs ONE yes. NOT = The Opposite Person — always disagrees!
Evaluating a Compound Expression: Y = A·B + C
| A | B | C | A·B | Y = A·B + C |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
"Draw the truth table for Y = A + B'." — 2-mark question. Answer: Evaluate B' (NOT B) first for each row, then apply OR with A. Total rows = 2ⁿ where n = number of variables (here, 2² = 4 rows).
3.4 🚪 Basic Logic Gates
A Logic Gate is a physical electronic circuit that implements a Boolean/logical operation — taking one or more inputs and producing ONE output.
3.4.1 Inverter (NOT Gate) 🚫
graph LR
IN["A"] -->|"NOT Gate\n—▷o—"| OUT["Ā (NOT A)"]
style IN fill:#2196F3,color:#fff
style OUT fill:#F44336,color:#fff
Truth Table:
| A | Output (Ā) |
|---|---|
| 0 | 1 |
| 1 | 0 |
The NOT gate has only ONE input and simply FLIPS/inverts it.
3.4.2 OR Gate ➕
graph LR
A["A"] --> GATE["OR Gate"]
B["B"] --> GATE
GATE --> OUT["A + B"]
style GATE fill:#4CAF50,color:#fff
Truth Table:
| A | B | A + B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
OR Gate Rule: Output is TRUE if AT LEAST ONE input is TRUE. Only FALSE when BOTH inputs are FALSE.
3.4.3 AND Gate ✖️
graph LR
A["A"] --> GATE["AND Gate"]
B["B"] --> GATE
GATE --> OUT["A · B"]
style GATE fill:#2196F3,color:#fff
Truth Table:
| A | B | A · B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
AND Gate Rule: Output is TRUE ONLY when BOTH inputs are TRUE. Any single FALSE input makes the whole output FALSE.
"Draw the logic symbol and truth table for AND, OR, and NOT gates." — 3-mark question.
3.5 📐 Basic Postulates of Boolean Logic
Postulates are the fundamental, self-evident RULES that form the foundation of Boolean Algebra — accepted as true without needing proof.
Closure
Combining two Boolean values with AND/OR always gives another Boolean value
1 AND 0 = 0 (still a valid Boolean value)Identity Elements
0 is the identity for OR; 1 is the identity for AND
A + 0 = AA · 1 = ACommutativity
Order doesn't matter for AND/OR
A+B = B+ADistributivity
AND distributes over OR and vice versa
A·(B+C) = A·B + A·CComplement
Every value A has a complement A' such that A+A'=1 and A·A'=0
Fundamental for NOT operation3.6 🔄 Principle of Duality
The Principle of Duality states that EVERY valid Boolean expression remains valid if you SWAP:
- AND ↔ OR
- 0 ↔ 1
graph LR
ORIG["Original Expression\nA + 0 = A"]
SWAP["Swap AND↔OR, 0↔1"]
DUAL["Dual Expression\nA · 1 = A"]
ORIG --> SWAP --> DUAL
style ORIG fill:#2196F3,color:#fff
style DUAL fill:#4CAF50,color:#fff
More Duality Examples:
| Original | Dual (swap AND↔OR, 0↔1) |
|---|---|
| A + 1 = 1 | A · 0 = 0 |
| A + A = A | A · A = A |
| A + A' = 1 | A · A' = 0 |
Analogy: Duality is like a MIRROR IMAGE — every rule has a "twin" rule where AND and OR simply swap places, and 0/1 swap places too. If one is TRUE, the mirrored version is AUTOMATICALLY true as well!
"Write the dual of the expression: A·(B+C)" — 1-mark question! Answer: Swap · with +, and + with ·: A + (B·C)
3.7 📜 Basic Theorems of Boolean Algebra/Logic
These are the LAWS you'll use CONSTANTLY to simplify Boolean expressions — memorise them well!
3.7.1 Properties of 0 and 1
| Law | Expression |
|---|---|
| OR with 0 | A + 0 = A |
| OR with 1 | A + 1 = 1 |
| AND with 0 | A · 0 = 0 |
| AND with 1 | A · 1 = A |
3.7.2 Indempotence Law
"Combining a variable with ITSELF changes nothing."
| Law | Expression |
|---|---|
| OR form | A + A = A |
| AND form | A · A = A |
3.7.3 Involution (Double Negation)
"NOT-NOT A equals A" — flipping twice returns the original!
(A')' = A
Analogy: Like saying "It's NOT that I DON'T like pizza" — the double negative means you DO like pizza! Two NOTs cancel out.
3.7.4 Complementarity Law
| Law | Expression |
|---|---|
| OR form | A + A' = 1 |
| AND form | A · A' = 0 |
A value combined with its OPPOSITE via OR is ALWAYS true; combined via AND is ALWAYS false.
3.7.5 Commutative Law
"Order doesn't matter" — just like in regular math!
| Law | Expression |
|---|---|
| OR form | A + B = B + A |
| AND form | A · B = B · A |
3.7.6 Associative Law
"Grouping doesn't matter" — how you bracket the terms doesn't change the result.
| Law | Expression |
|---|---|
| OR form | (A+B)+C = A+(B+C) |
| AND form | (A·B)·C = A·(B·C) |
3.7.7 Distributive Law
"AND/OR distribute over each other" — similar to multiplication distributing over addition in regular math.
| Law | Expression |
|---|---|
| AND over OR | A·(B+C) = A·B + A·C |
| OR over AND | A+(B·C) = (A+B)·(A+C) |
In regular math, addition does NOT distribute over multiplication (2+(3×4) ≠ (2+3)×(2+4)). But in Boolean Algebra, BOTH directions work! This is a key difference students often miss.
3.7.8 Absorption Law
"A larger expression gets 'absorbed' into a simpler one."
| Law | Expression |
|---|---|
| Form 1 | A + (A·B) = A |
| Form 2 | A · (A+B) = A |
Analogy: If you already own a "car" (A), owning "a car AND a specific model of that car" (A·B) doesn't add anything NEW — it's absorbed into just owning "a car" (A)!
3.7.9 Some Other Rules of Boolean Logic Algebra
| Rule | Expression |
|---|---|
| Redundancy Law | A + A'B = A + B |
| Consensus Theorem | AB + A'C + BC = AB + A'C |
Complete Boolean Laws — Master Summary Table:
| Law Name | OR Form | AND Form |
|---|---|---|
| Identity | A+0=A | A·1=A |
| Null/Dominant | A+1=1 | A·0=0 |
| Idempotent | A+A=A | A·A=A |
| Complement | A+A'=1 | A·A'=0 |
| Commutative | A+B=B+A | A·B=B·A |
| Associative | (A+B)+C=A+(B+C) | (A·B)·C=A·(B·C) |
| Distributive | A+(B·C)=(A+B)·(A+C) | A·(B+C)=A·B+A·C |
| Absorption | A+(A·B)=A | A·(A+B)=A |
"Simplify the expression: Y = A + A·B" — 2-mark question, uses Absorption Law! Answer: By Absorption Law, A + A·B = A
3.8 🔄 DeMorgan's Theorems
DeMorgan's Theorems are central to this chapter — they explain how NOT interacts with AND/OR!
3.8.1 DeMorgan's First Theorem
(A · B)' = A' + B'
"The complement of an AND expression equals
the OR of the individual complements"
Verification via Truth Table:
| A | B | A·B | (A·B)' | A' | B' | A'+B' |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 ✅ |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 ✅ |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 ✅ |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 ✅ |
Both (A·B)' and A'+B' produce IDENTICAL results in every row — proving the theorem!
3.8.2 DeMorgan's Second Theorem
(A + B)' = A' · B'
"The complement of an OR expression equals
the AND of the individual complements"
Verification via Truth Table:
| A | B | A+B | (A+B)' | A' | B' | A'·B' |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 ✅ |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 ✅ |
| 1 | 0 | 1 | 0 | 0 | 1 | 0 ✅ |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 ✅ |
Memory Trick! 🎵 "Break the bar, change the operator!" When you push a NOT bar INSIDE brackets, it BREAKS apart onto each variable, AND the operator FLIPS (AND↔OR)!
graph TD
A["(A·B)'"]
B["Break the bar,\nFlip AND to OR"]
C["A' + B'"]
A --> B --> C
style A fill:#F44336,color:#fff
style C fill:#4CAF50,color:#fff
"State and verify DeMorgan's First Theorem using a truth table." — 3-mark question. Answer: (A·B)' = A'+B'. Verify by constructing truth tables for both sides and showing they match in every row (as shown above).
3.9 🚪 More about Logic Gates
Beyond the basic 3 gates, these DERIVED gates are built by COMBINING basic gates — and are extremely important in circuit design!
graph TD
MORE["🚪 MORE LOGIC GATES"]
NOR["NOR = NOT(OR)"]
NAND["NAND = NOT(AND)"]
XOR["XOR = Exclusive OR"]
XNOR["XNOR = Exclusive NOR"]
MORE --> NOR
MORE --> NAND
MORE --> XOR
MORE --> XNOR
style NOR fill:#FF9800,color:#fff
style NAND fill:#9C27B0,color:#fff
style XOR fill:#F44336,color:#fff
style XNOR fill:#2196F3,color:#fff
3.9.1 NOR Gate (NOT + OR)
Truth Table:
| A | B | A+B | NOR = (A+B)' |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 |
NOR = OR gate followed by a NOT — output is the exact OPPOSITE of a regular OR gate!
3.9.2 NAND Gate (NOT + AND)
Truth Table:
| A | B | A·B | NAND = (A·B)' |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
NAND = AND gate followed by a NOT — output is the exact OPPOSITE of a regular AND gate!
Fun fact: EITHER a NAND gate ALONE, or a NOR gate ALONE, can be used to build ANY other logic gate (AND, OR, NOT, everything)! This is why they're called "Universal Gates" — extremely important in real hardware design.
3.9.3 XOR Gate (Exclusive OR)
Truth Table:
| A | B | A ⊕ B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
XOR Rule: Output is TRUE only when inputs are DIFFERENT from each other. If BOTH are the same (both 0 or both 1), output is FALSE.
Analogy: XOR is like an "Either-Or, but NOT Both" situation — "You can have cake OR ice cream" (not both, and not neither)!
3.9.4 XNOR Gate (Exclusive NOR)
Truth Table:
| A | B | XNOR = (A⊕B)' |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
XNOR Rule: Output is TRUE when inputs are the SAME (both 0 or both 1) — exactly the OPPOSITE of XOR!
All 7 Logic Gates — Complete Summary Table:
| Gate | Symbol | Output TRUE When... |
|---|---|---|
| AND | · | BOTH inputs are 1 |
| OR | + | AT LEAST ONE input is 1 |
| NOT | ' | Input is 0 (inverts) |
| NAND | (·)' | NOT both 1 (opposite of AND) |
| NOR | (+)' | NEITHER is 1 (opposite of OR) |
| XOR | ⊕ | Inputs are DIFFERENT |
| XNOR | (⊕)' | Inputs are the SAME |
"Differentiate between XOR and XNOR gate with truth tables." — 2-mark question. Answer: XOR gives TRUE when inputs DIFFER (0,1 or 1,0). XNOR gives TRUE when inputs are the SAME (0,0 or 1,1) — it's the exact complement of XOR.
3.10 🔌 Logic Circuits
A Logic Circuit combines MULTIPLE logic gates together to implement a COMPLEX Boolean expression.
Example: Building the circuit for Y = A·B + C
graph LR
A["A"] --> AND["AND Gate"]
B["B"] --> AND
AND --> OR["OR Gate"]
C["C"] --> OR
OR --> Y["Y = A·B + C"]
style AND fill:#2196F3,color:#fff
style OR fill:#4CAF50,color:#fff
Steps to Draw a Logic Circuit from a Boolean Expression:
- Identify all the input variables
- Identify the operators used (AND/OR/NOT) and their ORDER
- Draw gates matching each operator, connecting inputs correctly
- Follow operator precedence: NOT is applied FIRST, then AND, then OR (just like math's BODMAS!)
"Draw the logic circuit for the Boolean expression Y = (A+B)·C'" — 3-mark question, common practical question! Steps: (1) OR gate for A+B, (2) NOT gate for C', (3) AND gate combining the OR output with C' output.
⚠️ Common Errors and Misconceptions
| Mistake | What's Wrong | Correct Understanding |
|---|---|---|
| ❌ Confusing AND and OR truth tables | Different rules for TRUE output | ✅ AND needs BOTH true; OR needs AT LEAST ONE true |
| ❌ Applying DeMorgan's without flipping the operator | Only breaking the bar, not swapping AND/OR | ✅ Must BOTH break the bar AND swap AND↔OR |
| ❌ Thinking XOR and OR are the same | XOR excludes the "both true" case | ✅ XOR is FALSE when both inputs are TRUE; OR is TRUE in that case |
| ❌ Forgetting Distributive Law works BOTH ways in Boolean Algebra | Assuming it only works like regular math | ✅ BOTH A·(B+C)=AB+AC AND A+(BC)=(A+B)(A+C) are valid |
| ❌ Thinking NAND/NOR are just "extra" gates with no special use | Underestimating their importance | ✅ NAND and NOR are UNIVERSAL gates — can build any other gate from them alone |
| ❌ Applying Absorption Law incorrectly | Confusing which terms get absorbed | ✅ A+(A·B)=A — the SMALLER standalone term "wins" |
Basic Operators:
AND (·) → TRUE only if BOTH true
OR (+) → TRUE if AT LEAST ONE true
NOT (') → Inverts the value
DeMorgan's Theorems
(A·B)' = A' + B' (First Theorem)
(A+B)' = A' · B' (Second Theorem)
"Break the bar, flip the operator!"
All 7 Logic Gates:
| Gate | Rule |
|---|---|
| AND | Both TRUE → TRUE |
| OR | Any TRUE → TRUE |
| NOT | Inverts |
| NAND | Opposite of AND |
| NOR | Opposite of OR |
| XOR | Different → TRUE |
| XNOR | Same → TRUE |
Key Laws:
- Identity: A+0=A, A·1=A
- Null: A+1=1, A·0=0
- Idempotent: A+A=A, A·A=A
- Complement: A+A'=1, A·A'=0
- Absorption: A+(AB)=A
Principle of Duality: Swap AND↔OR and 0↔1 to get the dual expression.
🎯 Sample Exam Questions
Q1: Very Short Answer [1 mark each]
a) Who developed Boolean Logic? → George Boole
b) What are the two values used in Boolean Algebra? → TRUE (1) and FALSE (0)
c) Write the dual of A + 0 = A. → A · 1 = A
d) State DeMorgan's First Theorem. → (A·B)' = A' + B'
e) Which gate gives TRUE output only when both inputs differ? → XOR Gate
Q2: Short Answer [2 marks]
Q: Simplify the Boolean expression: Y = A + A'B
Using the Redundancy Law: A + A'B = A + B Answer: Y = A + B
Q3: Short Answer [3 marks]
Q: State and verify DeMorgan's Second Theorem using a truth table.
Statement: (A+B)' = A' · B'
| A | B | A+B | (A+B)' | A' | B' | A'·B' |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Both columns (A+B)' and A'·B' match exactly, verifying the theorem.
Q4: Truth Table [2 marks]
Q: Draw the truth table for Y = AB' + A'B
| A | B | B' | A' | AB' | A'B | Y=AB'+A'B |
|---|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 | 0 |
(Notice: this is exactly the XOR truth table!)
Q5: Circuit Drawing [3 marks]
Q: Draw the logic circuit for Y = (A + B)·C
Steps: (1) Feed A and B into an OR gate. (2) Take the OR gate's output and C into an AND gate. (3) The AND gate's output is Y.
✏️ Practice Problems
-
Construct the truth table for the expression Y = (A+B)·(A+C).
-
Simplify: Y = A·(A+B) using the Absorption Law.
-
State DeMorgan's First Theorem and apply it to simplify (A'+B')'.
-
Differentiate between NAND and NOR gates with truth tables.
-
Write the dual of the expression: A·(B+C) = A·B + A·C
-
Draw the logic circuit for Y = A'·B + A·B'
-
Explain why NAND and NOR gates are called "Universal Gates."
-
Simplify the expression Y = AB + A'C + BC using the Consensus Theorem.
-
Construct a truth table comparing XOR and XNOR gates for the same two inputs A and B.
-
A circuit has inputs A, B, C, and the Boolean expression Y = A·B + A·C. Simplify this expression using the Distributive Law and draw the simplified logic circuit.