In the last post, we saw why computers represent the world with simple bits, 0 and 1. But if all it did was store bits, a computer would be nothing more than a storage device. Its real power lies in processing bits meaningfully to produce the results we want.
Take a bank vault, for example. It opens when two employees each turn their own key, but the branch manager can open it alone by tapping a card.
Can we express logic like this with bits? First, let’s look at how to write this logic as an expression.
The 19th-century English mathematician George Boole created a system that expresses human logical reasoning like mathematics, using just two values, true and false, and a few operations. This is called Boolean algebra. Its main operations are:
The vault opens “when Key 1 and (∧) Key 2 are both turned, or (∨) the card is tapped,” so in Boolean algebra we write:
Open = (Key1 ∧ Key2) ∨ Card
To check whether the expression is right, we can go through every combination of keys and card. Let’s set true to 1 and false to 0. Then the vault’s logic can be written in bits.
Something that takes true/false values as input and gives back true/false according to a fixed rule is called a Boolean function, and a table that lists the rule for every combination of inputs is called a truth table. Spelled out as a truth table, the vault looks like this:
| Open | |||
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
But how can this expression be turned into a machine? The person who connected abstract logic to electrical circuits was the American mathematician Claude Shannon.
In his 1937 MIT master’s thesis, A Symbolic Analysis of Relay and Switching Circuits, Shannon showed that circuits made of switches can be written and calculated as Boolean algebra expressions.

Thanks to this, circuits that used to be designed by intuition could be designed with expressions, and simpler circuits could be found by simplifying the expressions.
Let’s build the vault as a circuit, Shannon’s way. Suppose that turning a key or tapping the card closes a switch and connects it, and that the door’s lock releases when current flows. We treat current flowing as true and no current as false.
Both wires are broken, so the lock stays locked.
The expression became a circuit as is. Today’s computers do the same thing not with switches flipped by hand, but with transistors, tiny semiconductor switches turned on and off by electrical signals. How transistors work belongs to physics, so this series stops here.
In the next post, let’s look at the basic parts that build these Boolean functions into real circuits: the AND, OR, and NOT logic gates.
Open = (Key1 ∧ Key2) ∨ Card. Which of the following always gives the same value as Open, whatever the values of Key1, Key2, and Card?