Theory
The strangest equation you will love
Here is an equation that is completely correct in this unit:
1 + 1 = 1
Not a typo. In Boolean algebra, + does not mean add, it means OR, and "true or true" is still just true.
This tiny two-value algebra of 0 and 1 is the mathematics your entire computer runs on, from the processor to every if-statement.
Theory
Switches, not numbers
Forget quantities. A Boolean variable is a light switch: OFF (0) or ON (1), nothing in between. Boolean operations describe how several switches control one bulb: in series (both must be on), in parallel (either one is enough), or inverted. All of Boolean algebra is switch wiring written as symbols.
Theory
Variables and the three operations
A Boolean variable (A, B, X) takes only 0 or 1.
Three operations build everything:
- NOT (complement) A′ or ¬A: flips the value
- AND, written as multiplication A·B or AB: 1 only when both are 1
- OR, written as addition A + B: 1 when at least one is 1
The multiplication and addition notation is deliberate: AND behaves like ×, OR almost like +.
Theory
The arithmetic of switches
All possible calculations, in two lines each:
A · B : 0·0 = 0 0·1 = 0 1·0 = 0 1·1 = 1
A + B : 0+0 = 0 0+1 = 1 1+0 = 1 1+1 = 1
And complement: ¬0 = 1, ¬1 = 0.
Only one entry defies school arithmetic: 1 + 1 = 1. The output cannot exceed 1 because "true" has no bigger version.
Quiz
In Boolean algebra, what is 1 + 1 · 0?
- 1
- 0
- 2
- Undefined
Show the answer
1
AND (·) binds before OR (+), just like × before + in school: 1·0 = 0 first, then 1 + 0 = 1. If you got 0 you did the OR first, and 2 is impossible: no Boolean value exceeds 1. Operator precedence carries over exactly from ordinary algebra.
Think first
A = 1, B = 0, C = 1.
Evaluate X = A·B + ¬B·C in your head, step by step, before tapping.
Show the answer
A·B = 1·0 = 0. ¬B = 1, so ¬B·C = 1·1 = 1. Finally X = 0 + 1 = 1.
The method scales to any expression: complements first, then the AND products, then OR the results. Write the intermediate values down in exams; each step usually carries a mark.
Theory
Expressions are circuits in disguise
Every Boolean expression describes a physical logic gate circuit:
- X = A·B is an AND gate: output on only when both inputs are on
- X = A + B is an OR gate: output on when either input is on
- X = ¬A is a NOT gate (inverter)
Write an expression, and an electronics engineer can wire it. Simplify the expression, and the circuit needs fewer gates: that is why this algebra exists.
Quiz
An ATM dispenses cash (X = 1) only when the card is valid (A = 1) AND the PIN is correct (B = 1). Which expression models it?
- X = A + B
- X = A · B
- X = ¬A · B
- X = A + ¬B
Show the answer
X = A · B
Both conditions must hold together, which is AND: X = A·B. With OR (option A) a stolen card with a wrong PIN would still pay out as long as one condition held. Translating English "and/or/not" into · , + and ¬ is the core exam skill of this unit.
Watch out
Old habits that break Boolean answers
Never write 1 + 1 = 2: the examiner reads it as not understanding OR. Never treat A + A as 2A: it is just A. And respect precedence: A + B·C means A + (B·C), not (A + B)·C. Brackets in Boolean algebra matter as much as in C code.
Theory
Where you will meet this again
You already know this algebra: it is the truth-table logic from the Mathematical Logic unit with T renamed 1 and F renamed 0, ∧ becoming · and ∨ becoming +. Ahead: Boolean functions, simplification laws and circuit design, plus every bitwise operator (&, |, ~) you will use in C.
Summary
Key takeaways
- Boolean variables take exactly two values, 0 and 1, like switches.
- NOT flips, AND (·) needs both to be 1, OR (+) needs at least one, so 1 + 1 = 1.
- AND binds before OR, exactly like × before + in school algebra.
- Every expression is a gate circuit: · is AND, + is OR, complement is NOT.
- Memory hook: switches, not numbers.