# What is a computer?

By Christian Genco. Published 2026-03-11.

> You use one every day but probably can't explain how it works. Here's why understanding the basics changes how you think about AI.

You use a computer for hours every day. You make million-dollar decisions based on what one tells you. But if someone asked you _how it actually works_ (not "it has a processor" but _what is actually happening inside that thing_) could you explain it?

Most executives can't. That's fine. You don't need to know how an engine works to drive a car. But we're not in the "driving a car" era of computing anymore. We're in the era where the car is starting to drive itself, and it's worth understanding what's under the hood.

I'm going to explain how a computer works starting from the absolute basics. It'll take about ten minutes. By the end, you'll have a much better intuition for the fundamentals of how a computer actually works, which will make it way easier to build up to understanding [how AI works](https://gxb.vc/thoughts/what-is-ai).

## It starts with a faucet

Turn a faucet on: water flows. Turn it off: water stops.

_Interactive demo: A faucet valve toggles between open and closed. When open, water flows through the pipe. When closed, the flow stops. This demonstrates the fundamental binary state — 1 and 0, on and off — that all computing is built on._

That's it. That's the fundamental thing a computer does. Not with water, but with electricity. Everything else (every spreadsheet, every video call, every AI chatbot) builds on top of this tiny building block of tiny valves turning on and off.

Water is actually a great way to think about it. Electricity works a lot like plumbing: current flows through wires like water flows through pipes. A valve controls whether the flow passes through or gets blocked. Open the valve: flow. Close it: no flow. Two states: on and off. **1** and **0**.

One valve isn't very useful. But what if you had _two_ valves controlling the same pipe?

## Transistors: tiny automatic valves

The faucet above requires _you_ to turn it. But what if the water pressure from one pipe could open or close a valve on a different pipe? That's a **transistor**.

_Interactive demo: A transistor shown as a water analogy. A horizontal pipe has a manual valve (click to toggle). When the valve is open, water pressure from the horizontal pipe activates a 'transistor' box, which opens a vertical pipe and lets water flow through it. The key insight: one flow of water controls whether a different flow is allowed through._

In the 1940s, engineers figured out that certain materials (silicon, mostly) could act as an electrical valve controlled by _another_ electrical signal instead of your finger. Flow in one wire controls whether flow is allowed through a different wire. No human needed.

_Interactive demo: The same transistor concept but with electricity instead of water. A switch on a horizontal wire controls whether current flows through a vertical wire via a transistor. It toggles rapidly (every 500ms) to show how fast electrical transistors can switch — billions of times per second in a real chip._

Because they're controlled by electricity instead of fingers, they can switch _really fast_. Billions of times per second. And because they're made of silicon, you can make them _really small_. The chip in your phone has about 15 billion transistors, each one smaller than a virus.

But a transistor by itself is still just an on/off valve. The interesting part is what happens when you start combining them.

## Logic gates: switches controlling switches

When you wire a few transistors together in specific patterns, you get something called a **logic gate**. A logic gate takes one or two inputs (each either on or off) and produces one output (on or off) based on a simple rule.

There are just a few kinds that matter:

- **AND gate** : the output is on only if _both_ inputs are on. Think of two switches wired in a line. Both need to be on for the light to work.
- **OR gate** : the output is on if _either_ input is on. Think of two switches wired side by side. Either one can light it up.
- **NOT gate** : flips the input. On becomes off. Off becomes on.

That's basically it. Three rules. AND, OR, and NOT.

_Interactive demo: Three logic gates side by side — AND, OR, and NOT. Each has clickable input switches that cycle through all possible combinations. AND: output is on only when both inputs are on. OR: output is on when either input is on. NOT: output is the opposite of the input. The outputs light up with a ⚡ when active._

This might feel too simple to be useful. But _every single computation a computer has ever done_ is built from just these three building blocks that were in turn built out of the smaller simpler transistor building block. AND, OR, NOT, billions of times per second.

## Doing math with switches

This is where it gets cool. You can wire logic gates together to _do addition_. Let's build a calculator to add two single-digit binary numbers using only the AND, OR, and NOT gates we talked about above.

This is a pretty simple calculator because there are only four possible cases we have to think about. We could be adding 0 + 0, which is just 0. We could be adding 0 + 1, which is just 1. We could be adding 1 + 0, which is also just 1. Or the tricky one: 1 + 1, which is 2, which in binary is `10`. So we write 0 and carry the 1.

Let's focus on the carry digit first. Look at our four cases: 0+0, 0+1, 1+0, 1+1. The carry digit is only 1 when _both_ inputs are 1. That sounds a lot like an AND gate.

_Interactive demo: An AND gate computing the carry digit of binary addition. Two inputs (A and B) cycle through all four combinations (0+0, 0+1, 1+0, 1+1). A truth table alongside highlights the current row. The AND gate outputs 1 only when both inputs are 1, which is exactly when binary addition produces a carry. Truth table: A=0 B=0 → carry=0, A=0 B=1 → carry=0, A=1 B=0 → carry=0, A=1 B=1 → carry=1._

That handles the carry digit. Now what about the sum digit? Look at the pattern: 0, 1, 1, 0. That _almost_ looks like OR (0, 1, 1, 1) except for the last case. When both inputs are 1, OR gives us 1 but we want 0.

So we need: "OR, but not when both are on." We can build that. Take OR(A, B). Then take AND(A, B) and NOT it. Then AND those two results together. That gives us exactly the pattern we want. (This combination is so useful it has its own name: **XOR** , "exclusive or.")

_Interactive demo: An XOR gate computing the sum digit of binary addition. Two inputs (A and B) cycle through all four combinations. XOR outputs 1 when exactly one input is on, but not both — giving the pattern 0, 1, 1, 0. A truth table alongside highlights the current row. Truth table: A=0 B=0 → sum=0, A=0 B=1 → sum=1, A=1 B=0 → sum=1, A=1 B=1 → sum=0._

If you bundle these two gates together (the AND for the carry and the XOR for the sum), you get a nice little package at a new level of abstraction: two inputs, two outputs. It's called a **half adder**.

_Interactive demo: A half adder — the combination of an AND gate (for carry) and an XOR gate (for sum) bundled into one unit. Two inputs (A and B) produce two outputs. Truth table: A=0 B=0 → carry=0 sum=0, A=0 B=1 → carry=0 sum=1, A=1 B=0 → carry=0 sum=1, A=1 B=1 → carry=1 sum=0. This is a complete single-digit binary calculator._

Chain a bunch of these together, and you can add numbers of any size. More logic gates can do subtraction, multiplication, and division. This collection of gates is called an **ALU** , an Arithmetic Logic Unit. It's the part of a computer that does math.

We've taken our tiny simple transistor building block, built it up into a slightly bigger logic gate building block, then built those into a half adder building block that can do math, then built those into a slightly bigger building block that can do any mathematical operation. See the pattern?

## Binary: counting with switches

If all you have is on and off (1 and 0), how do you represent a number like 42?

Think about it this way: if you have one switch, you can represent two states (off and on, 0 and 1). Two switches? Four states (00, 01, 10, 11). Three switches give you eight states, four gives you 16, five gets you 32, six gets you 64, etc.

_Interactive demo: A 4-bit binary counter with four toggle switches. It auto-counts from 0000 (0) to 1111 (15), incrementing every second. Each switch represents one bit; clicking a switch flips that bit. Below the switches, the decimal equivalent is displayed. This shows how four on/off switches can represent 16 different values (0–15)._

Every switch you add doubles the number of combinations. With eight switches (one **byte** ), you can represent 256 different values. That's enough for every letter, digit, and symbol on your keyboard.

This is the **binary number system**. A shortcut to counting in binary is to count only using numbers that are entirely made of zeros and ones. Start with 0 (that's 0). Then 1 (that's 1). The next number would be 2, but that has a digit other than 0 or 1, so skip it. Skip 3, 4, 5... all the way up to 10. So 10 = 2. What's the next number with only zeros and ones? 11. So 11 = 3. Now we have to go all the way up to 100 (= 4), then 101 (= 5), 110 (= 6), 111 (= 7), 1000 (= 8), 1001 (= 9), and so on.

Fun aside: you have 10 fingers, and each one can be up (1) or down (0). That means you can count to 1,023 on your hands using binary. Hold up your right pinky: that's 1. Put it down and raise your right ring finger: that's 2. Both up: 3. Just your right middle finger: 4. Try it.

_Interactive demo: Two hands with 10 fingers counting in binary from 0 to 1023. Each finger is a bit — up (1) or down (0). The fingers auto-increment rapidly, and the binary digits and decimal value are shown. This demonstrates that with 10 binary digits (fingers), you can count to 1,023 — far more than the usual 1-to-10._

(I would not recommend using this system to convey the numbers 4, 128, or 132 to someone.)

Everything in your computer (every number, every letter, every pixel of every photo) is stored as a pattern of 1s and 0s. On and off. Switches.

## Memory: switches that remember

There's one more trick. If you wire logic gates in a loop (so the output feeds back into the input) you can make a circuit that _remembers_. Set it to 1, and it stays at 1 even after you remove the input. Set it to 0, and it stays at 0.

_Interactive demo: A memory latch built from NOT, AND, and OR gates. RESET feeds through a NOT gate into an AND gate. The AND output feeds into an OR gate. SET also feeds into the OR gate. The OR output is Q (the stored bit), and it feeds back into the AND gate — creating a loop that remembers. The demo auto-cycles: SET pulses to store a 1, the value persists through idle cycles, then RESET pulses to clear it back to 0._

This is a **latch** , and it's how your computer stores information. Each one holds a single **bit** : one 1 or 0.

One bit by itself isn't very useful. But group eight of them together and you get a **byte** , which can represent 256 different values — enough for any letter, digit, or symbol on your keyboard. From there it's just a matter of scale:

| Unit | Bytes | Bits (switches) | Roughly… |
| --- | --- | --- | --- |
| 1 bit | ⅛ | 1 | a single yes/no |
| 1 byte | 1 | 8 | one letter or number |
| 1 kilobyte | 1,024 | 8,192 | a couple paragraphs of text |
| 1 megabyte | 1,048,576 | 8,388,608 | a photo or a short song |
| 1 gigabyte | 1,073,741,824 | 8,589,934,592 | a movie |
| 1 terabyte | 1,099,511,627,776 | 8,796,093,022,208 | ~500 hours of video |

That last row is worth pausing on. A terabyte is nearly nine _trillion_ switches. If each one were a physical light switch (about 1.5 by 3 inches), the switches in a single terabyte would cover about 9,000 square miles. That's roughly the size of New Jersey. But because transistors are smaller than viruses, you can fit a terabyte on a micro SD card small enough to swallow.

## The CPU: a very fast instruction follower

Now put it all together. A **CPU** (Central Processing Unit) is just:

1. An **ALU** (Arithmetic Logic Unit) that can do math and logic (thousands of **half adder** circuits like the one above, wired together)
2. Some **memory** to hold data and instructions (billions of **latch** circuits like the one above, wired together), along with a handful of **registers** : tiny, ultra-fast slots of working memory that hold whatever values the CPU is actively using right now
3. A **control unit** that runs a loop: _fetch_ the next instruction from memory, _decode_ what it means, then _execute_ it by telling the ALU what to do — over and over, billions of times per second

_Interactive demo: A CPU fetch-decode-execute cycle animation. Steps through a tiny program that computes 3 + 5 = 8: LOAD A,3 → LOAD B,5 → ADD A,B → STORE. The CPU reads each instruction from memory (fetch), figures out what it means (decode), then runs it in the ALU (execute). Registers A and B update as values are loaded, the ALU lights up during addition, and the final result (8) appears in the output. Illustrates that a CPU simply reads and executes simple instructions one at a time, very fast._

That's a computer. The instructions are dead simple. Things like "add these two numbers," "store this result here," "if this value is zero, skip to instruction #47." Each instruction is a pattern of 1s and 0s ( **machine code** ).

The CPU reads an instruction, does it, reads the next one, does it. Billions of times per second. That's all it does. There is no magic.

Every app on your phone, every website, every "intelligent" AI assistant: it's all just a long list of these tiny instructions being executed one after another, unimaginably fast.

## So what?

Why does any of this matter if you're running a company, not designing chips?

Because the entire history of computing is the story of building increasingly complex layers on top of these absurdly simple foundations. Light switches all the way down.

And AI is just the latest layer. When you hear "neural network" or "large language model," the computer underneath is still doing the same thing it's always done: executing simple instructions, billions of times per second, with no understanding of what any of it means.

That has some big implications, and it's what we'll get into next:

[What is AI? A plain-English explanation for people who run companies, not computer science departments.](https://gxb.vc/thoughts/what-is-ai)
