4.1 Boolean Variables and Expressions
Read and evaluate a Boolean expression built from variables restricted to {0,1}, correctly applying operator precedence and substitution to compute its output for a given input assignment.
Boolean algebra is the mathematical system that everything in Module 3 has been an application of: a formal algebra whose variables can hold only two values, 0 and 1, combined using the operators AND (·), OR (+), and NOT ('). This topic is where the informal gate-by-gate reasoning of Module 3 becomes a proper symbolic notation you can write down, manipulate, and evaluate on paper — which is essential, because every circuit from this point forward in the course (Boolean laws, De Morgan's theorem, SOP/POS forms, K-maps, and every combinational circuit in Module 6) is expressed and manipulated as a Boolean expression before it is ever drawn as a gate diagram. Learning to read an expression like F = A'B + AC correctly, and to evaluate it precisely for a specific set of input values, is the prerequisite skill for everything that follows in this module.
Core Concept: Variables Restricted to {0, 1}
A Boolean variable is a symbol — conventionally an uppercase letter like A, B, or C — that can take on exactly one of two values, 0 or 1, and no others. The spec states this restriction explicitly: A, B, C ∈ {0,1}. This is the single fact that makes Boolean algebra behave differently from ordinary algebra: there is no concept of a Boolean variable holding 2, or -1, or 0.5, and every operator (AND, OR, NOT) is defined only over this two-element domain, which is exactly why Boolean identities like A+A=A (covered in Module 4.2) look strange from an arithmetic point of view but are perfectly consistent within {0,1}.
A Boolean expression is any combination of Boolean variables joined by AND, OR, and NOT that evaluates, for any specific assignment of 0s and 1s to its variables, to a single Boolean value. The spec's example expression, F = A'B + AC, is built from exactly these three operators: NOT (the primes on A), AND (the juxtaposition/dot within each term, A'B and AC), and OR (the + joining the two terms). Reading it in words: 'F is true when A is false and B is true, or when A is true and C is true' — this direct translation between symbolic Boolean notation and plain-language conditions is a skill worth deliberately practicing.
• Boolean variables hold only 0 or 1 — never any other numeric value. • The three operators — AND (·), OR (+), NOT (') — are the only ones needed to build any Boolean expression. • F = A'B + AC is the spec's example: a Sum-of-Products-shaped expression combining two AND terms with OR. • Every Boolean expression, for any specific input assignment, evaluates to exactly one output value: 0 or 1.
Step-by-Step: Evaluating F = A'B + AC for A=1, B=1, C=0
Evaluating a Boolean expression for a specific input assignment is a mechanical substitution-and-reduction process, and the spec walks through exactly this for F = A'B + AC with A=1, B=1, C=0. Step 1 is substitution: replace every occurrence of each variable with its given value, being careful to also correctly evaluate any complemented (primed) variables — since A=1, A' becomes 0. Step 2 is evaluating each product (AND) term independently: A'B becomes 0·1, and AC becomes 1·0. Step 3 is evaluating each AND operation: 0·1 = 0, and 1·0 = 0 — using the AND rule from Module 3.2 that any 0 among the operands forces a 0 result.
The final step ORs the two reduced terms together: F = 0 + 0 = 0. The spec's own worked derivation shows exactly this chain: 'F = 0·1 + 1·0 = 0'. Working through it in this deliberate order — substitute, evaluate each AND term, then OR the results — prevents the most common evaluation error, which is trying to evaluate the whole expression in one mental step and losing track of a complemented variable along the way.
• Step 1: Substitute values, remembering to invert primed variables (A=1 → A'=0). • Step 2: Evaluate each AND term independently using the AND rule (any 0 input forces 0). • Step 3: OR the reduced terms together using the OR rule (any 1 input forces 1). • Spec result: F = A'B + AC at A=1,B=1,C=0 evaluates to F = 0·1 + 1·0 = 0.
Practical and Real-World Application: Specifying Circuit Behavior Before Building It
Writing a Boolean expression is almost always the very first step in real digital design, coming before any gate diagram or physical circuit exists: an engineer starts from a plain-language requirement ('the alarm should sound if either sensor trips'), converts it into a precise Boolean expression, and only then translates that expression into an actual gate-level circuit or, in modern practice, into a hardware description language like Verilog, where a line such as assign F = (~A & B) | (A & C); is a nearly direct transcription of F = A'B + AC into code syntax.
This same notation is also the language every later topic in this course is built on top of: Boolean laws (4.2) are rules for rewriting one expression into an equivalent one, De Morgan's laws (4.3) are rules for complementing an expression, SOP and POS (4.4, 4.5) are standard structural patterns for expressions, and K-maps (Module 5) are a graphical tool for simplifying an expression — none of these make sense without first being comfortable reading and evaluating expressions like F = A'B + AC exactly as this topic teaches.
Common Mistake and the Tricky Concept
The single most common evaluation mistake is forgetting to invert a primed variable during substitution — plugging in A's raw value (1) where A' appears, instead of correctly substituting A's complement (0). This single slip, in the spec's own example, would incorrectly turn A'B into 1·1=1 instead of the correct 0·1=0, and would change the final answer from F=0 to F=1 — a completely different, wrong result from one missed inversion.
A second, more conceptual trap is applying operator precedence incorrectly: in Boolean notation, NOT (') binds most tightly to the single variable it's attached to, AND binds next (evaluated before OR), and OR is evaluated last — exactly mirroring the order used above (invert, then AND within each term, then OR the terms together). Without holding this precedence firmly in mind, it's easy to misread A'B + AC as A'(B+A)C or some other incorrect grouping, especially once expressions grow longer than this topic's simple two-term example.
Boolean Variable and Expression Notation
A'B means (A') AND B — the prime applies only to A, not to the whole term, unless parentheses say otherwise. Juxtaposition (writing two variables side by side, like AC) is shorthand for AND, exactly like A·C.
Domain:
A, B, C ∈ {0, 1} (Boolean variables hold only 0 or 1)
Example expression:
F = A'B + AC
Operator precedence (tightest to loosest):
1. NOT (')
2. AND (·, or implied by juxtaposition, e.g. A'B)
3. OR (+)Code Examples
This is the spec's own worked example, evaluated in the recommended substitute-AND-then-OR order. Because A=1, its complement A' is 0, which makes the first term (A'B) evaluate to 0 regardless of B's value; the second term (AC) also evaluates to 0 because C=0. Both terms being 0 makes the final OR result 0. Expected result: F = 0 F = 0·1 + 1·0 = 0
Changing only A from 1 to 0 flips A' from 0 to 1, which now makes the first term (A'B) evaluate to 1 — and since OR only needs one 1 to produce a 1 result, F becomes 1 even though the second term (AC) still evaluates to 0. This contrast with the spec's own example demonstrates how sensitive an expression's output is to each individual variable. Expected result: F = 1 F = 1·1 + 0·0 = 1
F = A'B + AC
A = 1, B = 1, C = 0
Substitute: A' = 1' = 0
F = (0 · 1) + (1 · 0)
F = 0 + 0
F = 0F = A'B + AC
A = 0, B = 1, C = 0
Substitute: A' = 0' = 1
F = (1 · 1) + (0 · 0)
F = 1 + 0
F = 1Reading a Boolean Expression
Evaluation order: invert primed variables first, AND within each term, then OR the terms.
F = A' B + A C
│ │ │ │
invert │ raw raw
(NOT) AND term 1 AND term 2
(joined by OR)Important Rules
Boolean variables take only the values 0 or 1 — never any other value.
Operator precedence: NOT binds tightest, then AND, then OR (evaluated last).
A'B means (A') AND B; juxtaposed letters (AC) mean AND, exactly like the explicit dot notation A·C.
Every fully-substituted Boolean expression reduces to a single value: 0 or 1.
The Starting Point of Every Circuit Design
A Boolean expression is the precise, unambiguous middle step between a plain-language requirement and an actual circuit or HDL module: engineers write expressions like F = A'B + AC to capture exactly what a circuit should do, then simplify (Modules 4.9, 5) and implement that expression — and the same notation transcribes almost directly into hardware description language syntax, such as Verilog's assign F = (~A & B) | (A & C);.
Substituting a variable's raw value where its complement appears, e.g. plugging A=1 directly into A' instead of using A'=0.
Always substitute the complement's actual value: if A=1 then A'=0, and if A=0 then A'=1 — invert before you multiply or add.
In the spec's own example, forgetting this single inversion turns the correct evaluation (A'B = 0·1 = 0) into an incorrect one (1·1 = 1), silently changing the final answer from F=0 to F=1.
What values can a Boolean variable hold in Boolean algebra, as stated in the spec's notation A, B, C ∈ {0,1}? A. Any integer from 0 to 9 B. Only 0 or 1, and no other value C. Any real number between 0 and 1 D. True, False, or Unknown (three-valued logic)
B. Only 0 or 1, and no other value — The spec's syntax explicitly restricts Boolean variables to the set {0,1} — a strictly two-valued domain. This restriction is what distinguishes Boolean algebra from ordinary algebra and is why every AND/OR/NOT identity is defined purely over those two values.
[interview] For F = A'B + AC with A=1, B=1, C=0, what is F, and what is the single most common mistake that leads to the wrong answer? A. F = 1; the common mistake is forgetting to evaluate the OR at the end. B. F = 0; the common mistake is substituting A's raw value (1) into A' instead of correctly using A'=0. C. F = 0; the common mistake is applying AND before evaluating NOT. D. F = 1; the common mistake is treating + as arithmetic addition.
B. F = 0; the common mistake is substituting A's raw value (1) into A' instead of correctly using A'=0. — The spec's own derivation gives F = 0·1 + 1·0 = 0. The most common error that produces a wrong answer here is skipping the complement step — using A=1 directly where A' is required, instead of correctly substituting A'=0, which would incorrectly inflate the first term to 1.
Evaluate G = AB' + B'C + A'C for A=0, B=0, C=1. Show each term's value before combining them with OR.
A'=1, B'=1. AB' = 0·1=0. B'C = 1·1=1. A'C = 1·1=1. G = 0+1+1 = 1 (since OR needs only one 1 among any number of terms).
Compute A', B' first, then evaluate each of the three AND terms independently before OR-ing.