How can we make electricity make a decision?
“Can we build a circuit that makes simple decisions?”
In Section 1, we discovered how physical voltage maps to 0 and 1. But static values on wires cannot compute. Computation requires choice: “If A is true AND B is true, activate C.” In this section, we will construct physical logic gates, discover universal circuits, translate human sentences into mathematics, and minimize hardware.
Can Electricity Make a Decision? The Birth of the Truth Table
Before introducing mathematical symbols or logic gates, we look at physical switches. A truth table is simply a complete map of what a circuit does for every possible input combination.
If either switch is open, the conductive path is broken and no electrons reach the light bulb. The lamp only turns on when both Switch A AND Switch B are closed.
| Switch A | Switch B | Output Lamp (Y) | Physical State |
|---|---|---|---|
| 0 | 0 | 0 | DARK |
| 0 | 1 | 0 | DARK |
| 1 | 0 | 0 | DARK |
| 1 | 1 | 1 | ILLUMINATED |
Notice the highlighted row. As you toggle physical switches, the truth table maps the electrical input combination directly to the resulting output state.
Can a circuit answer “AND”?
An AND condition means an outcome happens ONLY when all required criteria are met simultaneously. For example, a car engine starts only if the key is turned ON AND the brake pedal is pressed down.
What does “both conditions must be true” mean?
It means the output is strictly dependent on the simultaneous presence of both signals. If even a single requirement is missing, the entire operation fails.
Can we build a circuit that behaves this way?
Yes. Placing two switches in series (one right after another) forces electric current to traverse both conductors to reach the output load.
What should happen for every possible input?
For (0,0), (0,1), and (1,0), the circuit path remains broken and the output is 0. Only for input (1,1) is the circuit complete, producing an output of 1.
How can we describe its behavior?
Mathematically, we write Y = A · B (or Y = AB). In schematics, we represent it using the standard D-shaped AND gate symbol.
2.1 The AND Gate: All Conditions Must Be Met Simultaneously
An AND condition means an outcome occurs ONLY when all required criteria are met simultaneously. Electrically, this is built using switches connected in series.
Electrical charge must traverse Switch A AND Switch B in series to illuminate the lamp.
The classic flat-backed, curved-front D-shape denotes an AND gate in international schematics.
| A | B | Y (Output) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Row 4 is the only state where the output is 1, matching the physical condition where all switches are closed.
George Boole used algebraic multiplication (dot notation or concatenation AB) to describe the AND operation mathematically.
What about “OR”?
An OR decision produces a positive result if at least one condition is true. For example, a house alarm turns on if the front door is opened OR the back window is opened.
What if either condition should be enough?
In hardware, we connect two switches in parallel (side-by-side). Electricity can reach the output through Path A OR Path B.
What happens when both are true?
In digital logic, OR is “inclusive”. If both switches are closed (1 and 1), current flows through both paths and the outcome is still TRUE (1).
What happens when neither is true?
When both switches are open (0 and 0), no current can cross either branch, so the output remains 0. Mathematically, Y = A + B.
2.2 The OR Gate: Triggers When At Least One Condition is True
An OR decision produces a positive output if at least one condition is met. In digital logic, OR is inclusive: if both inputs are 1, the outcome is still TRUE.
If either switch is closed, current bypasses the other branch and delivers power to the lamp.
The curved back and pointed arrowhead shape denotes an OR gate in schematic diagrams.
| A | B | Y (Output) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
The output is 0 ONLY when both inputs are 0. In all other three cases, the output is 1.
The plus symbol (+) denotes logical OR. It represents the combination of possibilities.
What about “NOT”?
Unlike AND and OR which combine multiple signals, a NOT circuit acts on a single line to reverse its state.
Can we reverse a signal?
Yes. A “NOT” circuit, also known as an Inverter, flips a digital signal. In schematics, it is drawn as a triangle with an inversion bubble at the output.
What happens to 1?
When the input is 1 (HIGH voltage), an NMOS pull-down transistor turns ON and drains the output line to Ground (0V), turning 1 into 0.
What happens to 0?
When the input is 0 (LOW voltage), the pull-down turns OFF and a PMOS pull-up connects the output line to the power supply rail (VDD), turning 0 into 1.
2.3 The NOT Gate: Reversing Digital Signals (The Inverter)
A NOT circuit, also called an Inverter, flips a digital signal. In silicon hardware, this is accomplished using a pair of complementary PMOS and NMOS transistor switches.
The triangular symbol represents a buffer amplifier, and the small circle (bubble) at the output represents inversion.
| Input A | Output Y (Ā) | State |
|---|---|---|
| 0 | 1 | 0 → 1 (INVERTED) |
| 1 | 0 | 1 → 0 (INVERTED) |
Because there is only 1 input variable, the truth table has exactly 2¹ = 2 possible states.
Can we combine these decisions?
By cascading the output of one gate into the input of another, we construct composite logic gates that perform specialized decision-making.
Can AND, OR and NOT build more complicated decisions?
Yes. Combining basic gates produces composite operators: NAND (NOT + AND), NOR (NOT + OR), XOR (Exclusive-OR), and XNOR (Exclusive-NOR).
Can we build NAND?
An AND gate followed by an Inverter. Output is 0 ONLY when both inputs are 1; otherwise 1. NAND is a universal gate—you can build any digital circuit in existence using only NAND gates.
Can we build NOR?
An OR gate followed by an Inverter. Output is 1 ONLY when both inputs are 0. If any input is 1, the output becomes 0.
Can we detect whether two signals are different?
Yes, using an XOR (Exclusive-OR) gate. XOR outputs 1 if the inputs are different (A ≠ B) and 0 if they are identical.
What is XNOR?
An equality comparator (A = B). XNOR outputs 1 only when both inputs match (0 and 0, or 1 and 1).
2.4 Combining Decisions: NAND, NOR, XOR, and XNOR
Basic gates combine to produce composite decision blocks. NAND and NOR form universal building blocks, while XOR and XNOR act as inequality and equality detectors.
An AND gate followed by an Inverter. Output is 0 ONLY when both inputs are 1; otherwise 1.
| A | B | NAND (Y) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Universal Gate: Any digital logic circuit in existence can be constructed entirely out of NAND gates.
Complex computer logic is built by chaining these composite decisions into vast networks.
Can we describe a circuit mathematically?
In the 19th century, mathematician George Boole created the branch of algebra that operates on truth values (1 and 0). This allows engineers to design and analyze complex circuits using algebraic equations before touching a physical wire.
How can we write the behavior of AND as an equation?
Using multiplication notation: Y = A · B (or Y = AB). Reflects that 1 · 1 = 1, while multiplying anything by 0 equals 0.
What is Boolean algebra?
A formal algebraic system where variables take values of 0 or 1, and the primary operations are AND (·), OR (+), and NOT (X̄ or X').
Can we go from a sentence to a Boolean expression?
Yes. For example, “Turn on alarm (Y) if armed (A) AND motion (M) OR emergency (E)” translates directly to Y = (A · M) + E.
Can we go from an expression to a circuit?
Yes: replace every dot (·) with an AND gate, every plus (+) with an OR gate, and every bar (X̄) with an Inverter.
Can we go from a circuit back to an expression?
Yes: trace backwards from the output wire, writing the mathematical operation for each logic gate until reaching the input terminals.
2.5 Converting English Sentences to Boolean Circuits: The Alarm System
Engineering requirements begin in spoken human language. Using Boolean algebra, we translate English sentences directly into mathematical equations, and then into physical logic schematics.
“Turn on alarm (Y) if the system is armed (A) AND motion is detected (M) OR emergency button is pressed (E).”
We extract discrete binary variables from the real-world sentence and identify the connective logic keywords.
We replace “AND” with multiplication ($\cdot$) and “OR” with addition ($+$), adhering to algebraic order of operations.
Every dot ($\cdot$) becomes an AND gate, every plus ($+$) becomes an OR gate, and wires route signals directly to the output.
How do we find a simpler circuit?
Two visually different circuits can perform the exact same computation. Finding the smallest, fastest circuit is a core task in semiconductor design.
Why would we want fewer gates?
Fewer gates mean a smaller silicon die area, cheaper manufacturing costs, lower power consumption, and shorter propagation delays for faster clock frequencies.
Can two different circuits perform the same function?
Yes. For example, the expression (A · B) + (A · B̄) requires 4 logic gates, but simplifies algebraically to A · (B + B̄) = A · 1 = A—a single copper wire!
How can we prove that they are equivalent?
By generating truth tables for both circuits. If the output column is identical for every single row, the circuits are 100% functionally equivalent.
What is a Karnaugh map?
A 2D graphic grid arranged in Gray code where adjacent cells differ by only 1 bit. Visually looping groups of 1s in powers of 2 ($1, 2, 4, 8$) instantly eliminates redundant variables without tedious algebra.
2.6 How Do We Find a Simpler Circuit? Simplification, Proofs & K-Maps
Fewer gates mean smaller silicon area, lower manufacturing costs, reduced power consumption, and faster circuit speeds. We use Boolean algebra, Truth Table proofs, and Karnaugh Maps to minimize hardware.
Fewer transistors fit in a smaller physical footprint.
More dies fit on each silicon wafer during manufacturing.
Eliminates parasitic capacitance and thermal heat.
Shorter electrical propagation delays through gates.
From Physical Switches to Universal Decision Machines
We started with physical mechanical switches and watched how series and parallel arrangements created the fundamental logic operations: AND, OR, and NOT. We saw that simple gates combine into universal NAND building blocks and XOR inequality detectors. Finally, we learned that Boolean algebra, Truth Tables, and Karnaugh Maps allow us to express, prove, and collapse complex circuits into optimized hardware.
“We can make decisions. Can we use those decisions to make a circuit that actually calculates?”
Having logic gates make static decisions is powerful, but how do millions of decisions add numbers, compute equations, and power a calculator? In Stage 03, we combine our decisions to build arithmetic adders and computational circuits.