# How a Computer Actually Works - The Parts, Explained Plainly

> What the handful of parts inside a computer actually are, how they work together to run a program, and why that explains everything from 'my laptop is slow' to which specs to care about when you buy one.


---

# How a Computer Actually Works

A computer can feel like a sealed box of magic - you press a key, things happen, and nobody ever told you *why*. The secret is almost embarrassingly simple: a computer is a machine that follows instructions, one after another, very fast. There are only a handful of parts inside, each with one clear job, and once you can name them and picture how they pass work to each other, the whole machine stops being mysterious.

This guide is for absolute beginners - no coding, no jargon you haven't been handed first. By the end you'll understand the parts, watch a program run in your head, and know exactly what those specs on a laptop ad actually mean for you.

## How to read this

- **Shopping for a computer right now?** Skip to [Phase 3: Fast vs Slow (and Buying a Computer)](03-fast-vs-slow.md) - it explains what the specs mean in plain language. The first two phases make those specs make *sense*, so come back to them.
- **Want it to finally click?** Read in order. Each phase builds the picture one layer at a time: first the parts, then how they cooperate, then why it matters in real life.

## The phases

1. **[The Parts and What They Do](01-the-parts.md)** - the small cast of components inside every computer (CPU, RAM, storage, the motherboard that connects them, plus power and the things you plug in), and the one mental model that ties them together.
2. **[How They Work Together to Run a Program](02-running-a-program.md)** - the journey of a program from storage into memory and into the CPU, instruction by instruction, and why your data has to keep moving toward the CPU to keep things fast.
3. **[Why This Explains "Fast vs Slow" (and Buying a Computer)](03-fast-vs-slow.md)** - what CPU cores, GHz, RAM, and SSD size really mean for you, and why "my computer is slow" almost always traces back to one specific part.

> This is the "A" rung - the absolute basics. When you want to go deeper on the three parts that matter most, read [CPU, RAM, and Storage](/guides/cpu-ram-and-storage). When you're curious what the *software* layer on top does, [What an Operating System Is](/guides/what-an-operating-system-is) picks up right where this guide ends.


---

# The Parts and What They Do

One idea underpins the whole machine:

> 💡 **Key point.** A computer is a machine that **follows a list of instructions, one after another, very fast.** That's it. Everything inside exists to store those instructions, fetch them, run them, and remember the results. The "very fast" is what makes a dumb list of steps feel like magic - modern computers run billions of tiny steps per second.

Seen that way, each part has an obvious job: do the steps, hold the data in use, remember it after power-off, connect it all.

## The big picture first

The whole cast on one page - just a few boxes, all connected by the same wiring.

```mermaid
flowchart LR
  Power[Power supply<br/>the wall] --> Board
  subgraph Board[The motherboard - wiring = the bus]
    direction LR
    CPU[CPU<br/>the worker] <-->|fast road| RAM[RAM<br/>fast temp workspace]
    CPU <-->|slower road| Storage[Storage<br/>permanent filing cabinet]
    CPU <--> IO[I/O<br/>keyboard, screen, network, USB]
  end
```

The **CPU** does the work, **RAM** is the fast workspace, **storage** is the permanent filing cabinet, the **motherboard** (and its **bus**) is the wiring that connects everything, and **power** plus **I/O** keep it running and let you talk to it. One at a time.

## The CPU - the worker that does the calculating

The **CPU** (Central Processing Unit, also called "the processor") is the part that actually *does* the instructions - reading each step and carrying it out: add these two numbers, compare them, move this byte over there. Nothing clever, nothing creative; very simple steps, astonishingly fast.

📝 **Terminology.** *CPU* = Central Processing Unit, the chip that executes instructions. People also say "the processor." The brand names you've seen - Intel Core, AMD Ryzen, Apple M-series, Snapdragon - are all CPUs.

The CPU isn't a "brain" that *understands* what you're doing - it's a tireless clerk following tiny, exact orders, billions of times faster than you can think. The cleverness lives in the *instructions* (the software); the CPU just runs them.

Everything your computer does - drawing this text, playing a video, loading a webpage - is the CPU running millions of these tiny steps. "This CPU has 8 cores" means eight clerks working on eight piles at once (more in [Phase 3](03-fast-vs-slow.md)). And "my CPU is at 100%" just means the worker is fully busy - more work piled up than it can get through.

## RAM - the fast temporary workspace

**RAM** (memory) is where the computer keeps what it's actively using *right now* - the top of a desk. The CPU can reach it almost instantly, so anything it's working on lives there: the open app, the document you're editing, the webpage on your screen.

📝 **Terminology.** *RAM* = Random-Access Memory. "Memory" and "RAM" mean the same thing in everyday use. It's measured in gigabytes (GB) - common laptops have 8, 16, or 32 GB.

The single most common mix-up in all of computing is confusing RAM with storage - memory with disk. Both hold "your stuff," but they do opposite jobs:

```text
   RAM (memory)                      STORAGE (disk / SSD)
   ─────────────                     ─────────────────────
   the desk you work on              the filing cabinet
   FAST                              SLOWER
   small (a few GB)                  big (hundreds of GB)
   FORGETS when power goes off  ←──  REMEMBERS when power goes off
```

The line that matters most: **RAM forgets everything when the power goes off; storage remembers.** That's why an unsaved document vanishes if your laptop dies - it was only ever on the desk (RAM), never filed away (storage). "Saving" means copying it from the fast-but-forgetful desk into the slow-but-permanent cabinet.

Opening an app pulls it out of storage onto the desk (RAM) so the CPU can get at it quickly. More RAM = more open at once before the desk runs out - which, as we'll see, is exactly when things get slow.

⚠️ **Gotcha.** "More memory" on a phone or laptop ad sometimes means storage, not RAM - sellers blur the two on purpose. RAM is the small, fast workspace; storage is the big, permanent cabinet. If the number is in the hundreds of GB, it's storage.

## Storage - the permanent filing cabinet

**Storage** (the disk, or on modern machines the **SSD**) is where everything is kept *permanently* - your files, your photos, your apps, and the operating system itself - even when the power is off. That's why your files are still there in the morning.

📝 **Terminology.** *SSD* = Solid-State Drive, the fast modern kind of storage with no moving parts. *HDD* = Hard Disk Drive, the older kind with a spinning magnetic platter - cheaper and bigger, but much slower. Both are "storage." Measured in gigabytes (GB) or terabytes (TB).

Nothing the CPU works on lives *directly* in storage - it's too slow for that. Things get copied from storage into RAM when you need them, worked on there, and copied back when you save. Storage is the warehouse; RAM is the workbench. The journey between them is the heart of [Phase 2](02-running-a-program.md).

This also separates two problems people conflate. A full *disk* means the filing cabinet is stuffed - you can't save new files. Out of *memory* means the desk is crowded - things slow down but nothing is lost. Delete files for the first; close apps for the second.

## The motherboard and the bus - the roads connecting everything

The **motherboard** is the big flat board that everything else plugs into: the CPU sits on it, the RAM slots into it, storage and all the ports connect to it. Running through the board is the wiring that carries data between the parts - collectively called the **bus**. The bus is the set of roads; the parts are the buildings.

A number the CPU needs travels from RAM across the bus; a file you save crosses it from RAM to storage. You don't manage this plumbing, but the *speed* of those roads is part of why some parts feel fast and others slow.

## Power and I/O - keeping it alive and letting you in

**Power** is the simplest: the **power supply** takes electricity from the wall (or the battery) and feeds it to everything on the motherboard at the right levels. No power, no instructions, no computer.

**I/O** stands for **Input/Output** - every part that lets information get *in* (keyboard, mouse, touchscreen, microphone) or *out* (screen, speakers), plus the network and the USB ports. Your keyboard is input; your screen is output; the network is both. To the CPU, all of these are just more things to read from and write to.

```mermaid
flowchart LR
  In["INPUT<br/>keyboard, mouse, network"] --> Computer["The computer<br/>CPU + RAM + storage"]
  Computer --> Out["OUTPUT<br/>screen, speakers, network"]
```

Information flows *in*, the machine works on it, results flow *out* - the shape of every program you'll ever run.

## Recap

1. A computer is a machine that **follows instructions one after another, very fast**. Every part serves that one job.
2. The **CPU** is the worker that does the instructions - fast and tireless, but not clever on its own.
3. **RAM** is the fast temporary workspace (the desk). Quick, but **forgets** when power goes off.
4. **Storage** (SSD/disk) is the permanent filing cabinet - slower, bigger, and it **remembers**. Saving means copying from RAM to storage.
5. The **motherboard** holds everything, and its **bus** is the wiring that carries data between the parts.
6. **Power** keeps it alive; **I/O** (keyboard, screen, network, ports) lets information in and out.

Now let's watch the parts cooperate - next we follow a single program from the filing cabinet into the worker's hands.

## Try it yourself

Everything inside is binary. Convert between bases and try a bitwise operation:

```playground-base
42
```


---

# How They Work Together to Run a Program

You met the parts in [Phase 1](01-the-parts.md). Now we follow a music player from double-click to sound coming out of your speakers: the parts hand work to each other in a steady relay, and that relay *is* "running a program."

## First: what is a program, really?

A **program** is a list of instructions saved as a file in storage. Sitting there, it's a recipe in a closed cookbook - doing nothing until the steps are read out and carried out.

📝 **Terminology.** *Program* = the instructions sitting in storage, not running (the recipe). A *running* program - loaded into RAM with the CPU working through it - is often called a **process** (the meal being cooked).

The whole journey follows from that: a program must be *moved* from storage to RAM before the CPU can do anything with it.

## The journey: from filing cabinet to worker

The relay, start to finish, when you open that music player:

```mermaid
flowchart LR
  Click["1. CLICK<br/>double-click the icon"] --> Storage[Storage]
  Storage -->|2. LOAD: copy up| RAM[RAM]
  RAM -->|3. FETCH + EXECUTE| CPU[CPU]
  CPU -->|4. OUTPUT| Out["Speakers / screen"]
```

Step 2 is the part most people have never been told: **the CPU can't run a program straight from storage** - it's far too slow to feed the worker. So opening *anything* starts with a copy, pulling the instructions up from the filing cabinet onto the desk. The spinning "loading" icon is largely this copy happening.

## The heartbeat: fetch, then execute

Once the program is in RAM, the CPU runs the same simple loop, forever, for every program:

```mermaid
flowchart LR
  Fetch["FETCH<br/>the next instruction"] --> Execute["EXECUTE<br/>do what it says"]
  Execute --> Move["MOVE ON<br/>to next step"]
  Move -->|repeat| Fetch
```

That's the entire job of a CPU: **fetch the next instruction, execute it, move on, repeat** - billions of times per second. Each step is tiny ("add these two numbers," "compare these," "put this result over there"). There's no grand plan inside the CPU; the plan is the program.

💡 **Key point.** Everything your computer does is this loop running underneath. When a game feels alive or a video plays smoothly, that's the CPU racing through the loop so fast the results blur into motion - a flipbook flipped fast enough to look like film.

It also demystifies freezes: a program "hangs" when its instructions told the CPU to wait for something (a file, the network) that hasn't arrived - the worker is stuck on one step.

## Why there's a hierarchy: fast, slower, much slower

The parts that hold data aren't equally fast. There's a ladder, and the rule is brutally simple: **the closer to the CPU, the faster - and the smaller and more expensive.**

```mermaid
flowchart TD
  Cache["Inside the CPU: registers &amp; cache<br/>blink-fast, but tiny"]
  RAM["RAM - the desk<br/>fast, a few GB"]
  Storage["Storage (SSD / hard drive)<br/>much slower, huge, permanent"]
  Cache -->|farther from the worker| RAM
  RAM -->|farther from the worker| Storage
```

The gaps between rungs are enormous - dramatically slower at each step down. The CPU's own scratchpad is near-instant; RAM is quick; storage is slow enough that the CPU would spend most of its time *waiting* if it worked from there.

📝 **Terminology.** This ladder is the **memory hierarchy**. The tiny ultra-fast storage inside the CPU is **cache** - a small stash of the data the CPU expects to need next, kept right where it can grab it.

Why not make all memory blink-fast? Because fast memory is expensive and only comes in small amounts; slow memory is cheap and huge. So computers use a bit of each: a tiny amount of blink-fast memory for *this instant*, a few gigabytes of RAM for *soon*, and a big slab of cheap storage for *everything else*. Speed where it counts, capacity where it doesn't.

Because the worker only runs fast when its data is close, the computer constantly shuttles data *up* the ladder - storage into RAM, RAM into cache - just ahead of need. When the CPU has to reach all the way down to storage instead, you feel it: the lag when an app you haven't touched in a while takes a beat to respond. It got shuffled down the ladder and has to climb back up.

⚠️ **Gotcha.** This is exactly why a computer that's "out of RAM" gets *painfully* slow instead of stopping. When the desk is full, the computer parks overflow down in slow storage and fetches it back as needed. Nothing crashes - but the CPU keeps waiting on the slow filing cabinet, so everything crawls. The fix isn't a faster CPU; it's more RAM or fewer things open. More in [Phase 3](03-fast-vs-slow.md).

## The whole picture, together

```mermaid
flowchart LR
  Storage["STORAGE<br/>cabinet"] -->|load| RAM["RAM<br/>desk"]
  RAM -->|fetch| CPU["CPU<br/>worker"]
  CPU -->|execute| Results[results]
  Results -->|output to screen / speakers / network| Out([out])
  Results -.->|save| Storage
```

A program lives in the cabinet, gets laid out on the desk, and the worker runs through it step by step - pulling data up the ladder to stay fast, pushing results out to you, saving what needs to last back into the cabinet. That relay, repeated billions of times a second, is a computer running.

## Recap

1. A **program** is instructions sitting in storage (a recipe). Running it means a **process**: instructions in RAM with the CPU working through them.
2. Opening anything first **copies it from storage into RAM** - the CPU can't work fast from the slow filing cabinet.
3. The CPU's whole job is the **fetch-execute loop**: get the next instruction, do it, repeat - billions of times a second.
4. The **memory hierarchy**: CPU cache (blink-fast, tiny) → RAM (fast, medium) → storage (slow, huge). Closer to the CPU means faster but smaller.
5. The computer constantly **moves data up the ladder** to stay quick; reaching down to slow storage is what lag feels like - and why being out of RAM makes everything crawl.

Last phase: what laptop specs mean, and why "my computer is slow" almost always points to one specific part.


---

# Why This Explains "Fast vs Slow" (and Buying a Computer)

Here's the payoff: the specs on a laptop box are just numbers describing the parts you now understand, and a slow computer is a part that can't keep up. Let's decode the specs, then turn the model into a calm troubleshooting checklist.

## The cheat-card: "my computer is slow" → which part?

A slow computer is rarely a mystery and rarely "just old" - it's almost always one part being the bottleneck. Start here; the sections below give the why.

| What you notice | Most likely the culprit | The plain fix |
|---|---|---|
| Everything crawls when many apps/tabs are open; gets better when you close some | **Not enough RAM** (desk too small) | Close apps/tabs; longer term, more RAM |
| The whole machine is sluggish even with little open; apps take ages to *start* | **Slow storage** (old spinning hard drive) | Move to an **SSD** |
| One specific heavy task (video export, a game, lots of number-crunching) is slow | **CPU** can't do the work fast enough | A faster / more-core CPU helps; or expect it to take time |
| "Disk full" warnings; can't save or update | **Storage is full** (cabinet stuffed) | Delete files; bigger drive |
| Was fine, suddenly slow, fans roaring | Often a program stuck in the fetch-execute loop, or **storage full** | Check what's using the CPU/disk; restart |

Every row points at a part you've already met.

## CPU specs: cores and GHz

The CPU is the worker. Two numbers describe it, both straight from the fetch-execute loop in [Phase 2](02-running-a-program.md).

**Cores - how many workers.** A **core** is one worker running the fetch-execute loop. More cores = more clerks doing separate piles of work *at the same time*: a 4-core chip genuinely runs four things at once; an 8-core, eight.

```text
   1 core:   [worker] ── one pile of work at a time
   4 cores:  [worker][worker][worker][worker] ── four piles at once
```

More cores help most for many things at once, or one app smart enough to split its work across workers (video editors, photo tools, big games). An unsplittable chain of steps sits on one core no matter how many you have.

**GHz - how fast each worker goes.** **Clock speed**, measured in **gigahertz (GHz)**, is roughly how many fetch-execute steps each core gets through per second. One GHz is a billion ticks per second.

📝 **Terminology.** "8-core, 3.2 GHz" means eight independent workers, each running about 3.2 billion ticks a second.

⚠️ **Gotcha.** GHz isn't a cross-chip "speed score": a newer 3 GHz CPU can run circles around an older 3.5 GHz one by getting *more useful work done per tick*. It compares cleanly only within the same generation and family - a rough hint, never "more GHz = faster computer."

**For buying:** almost any modern CPU is plenty for browsing, email, documents, and video - the CPU is rarely your bottleneck. Pay up for cores and GHz only for genuinely heavy work: video editing, serious gaming, compile-heavy programming, number-crunching.

## RAM: how big the desk is

RAM is the desk; the spec is **how many gigabytes**, and its effect on daily life is direct. The thing to internalize: RAM mostly doesn't make a given task *faster* - it lets you keep *more going at once* before the computer runs out of desk space and starts parking overflow in slow storage, the exact slowdown from [Phase 2](02-running-a-program.md).

```text
   Enough RAM:   plenty of desk → everything you opened fits → snappy
   Too little:   desk overflows → spill onto slow storage → crawl
```

💡 **Key point.** RAM is the single spec most likely to fix an *everyday* "this feels slow" - everyday slowness is usually too many things open for the desk you've got. It's why "close some tabs" genuinely helps: you're clearing the desk.

**For buying:** RAM is where a beginner's money is usually best spent. Rough, no-nonsense guide for a general-purpose laptop today: around 8 GB handles light use but fills up fast with many browser tabs; around 16 GB suits most people; 32 GB and up is for heavy multitaskers and demanding creative or development work. Rules of thumb, not hard limits - your real number depends on how much you keep open. When unsure, more RAM ages better than a slightly faster CPU.

## Storage: SSD vs hard drive, and size

Storage has *two* things worth caring about, and they're different.

**The kind matters more than people expect.** An **SSD** (solid-state drive) is dramatically faster than an old-style **hard drive (HDD)** with its spinning platter. This one choice is often the biggest single difference between a computer that feels instant and one that feels sluggish *everywhere* - because everything you open has to be read up from storage first ([Phase 2](02-running-a-program.md), step 2).

```text
   SSD:  no moving parts, reads fast   → apps & files open quickly
   HDD:  spinning platter, reads slow   → everything feels draggy
```

🪖 **War story.** The classic "my old laptop became unusable" complaint is, more often than not, a slow hard drive - not a worn-out CPU. Swapping its HDD for an SSD can make it feel years younger: the bottleneck was always the slow climb from storage.

**The size is the other number.** Capacity (GB or TB) is how much you can keep - files, photos, apps, the OS. Running low causes its own troubles: "disk full," failed updates, and on some systems extra slowness because the OS has no room to work.

⚠️ **Gotcha.** Don't confuse the *kind* of storage with the *amount*: a huge slow hard drive holds a lot but feels sluggish; a smaller SSD holds less but feels fast. For everyday responsiveness, the SSD wins nearly every time.

**For buying:** prioritize an SSD - treat a spinning hard drive as a deal-breaker for a primary computer. Then pick a capacity that fits your stuff with room to spare.

## Putting it all together

The model one last time, labeled with the specs on the box:

```text
   ┌──────────────────────────────────────────────────────────────┐
   │  CPU      = cores (how many workers) + GHz (how fast each)     │
   │             → matters most for heavy tasks                     │
   │  RAM      = gigabytes (how big the desk)                       │
   │             → matters most for everyday "many things open"     │
   │  STORAGE  = SSD vs HDD (how fast) + GB/TB (how much)           │
   │             → SSD matters for overall snappiness; size for fit │
   └──────────────────────────────────────────────────────────────┘
```

You don't need the biggest number in every row: for most people, a modern CPU, comfortable RAM, and a fast SSD make a computer that feels great. When something is slow, ask "which part can't keep up?" - and actually answer it.

## Recap

1. The specs on the box describe the parts you already know: **CPU** (cores + GHz), **RAM** (gigabytes), **storage** (SSD vs HDD, plus size).
2. **CPU cores** = how many workers at once; **GHz** = how fast each goes. Big tasks benefit; GHz isn't comparable across chip families.
3. **RAM** is the desk - more lets you keep more open before slowdown, and it's the most common fix for everyday sluggishness.
4. **Storage**: an **SSD** vastly outperforms an old hard drive for snappiness; capacity is a separate concern about how much you can keep.
5. **"My computer is slow" is diagnosable** - almost always one part as the bottleneck, and the cheat-card maps symptom to part.

That's the whole machine, connected to real decisions. To go deeper on the three parts that matter most, [CPU, RAM, and Storage](/guides/cpu-ram-and-storage) picks up here; for the software layer on top, read [What an Operating System Is](/guides/what-an-operating-system-is).
