CPU, RAM and Storage: Inside a Computer, Explained
Your laptop feels quick in the morning. By afternoon, with 30 tabs and a video call open, the mouse stutters and the fan roars. The cause usually lies in three parts: the CPU, RAM and storage, that is, the central processing unit, the random access memory and the drive that keeps your files. This lesson explains what each one does, how they work together, and which to suspect when things slow down.
One kitchen, three jobs
The key rule: the chef cooks only with what is on the countertop. In the same way, the CPU works only on programs and data that have first been copied into RAM. Nothing runs straight from storage.
If the countertop is too small, the chef keeps stopping to carry things to and from the pantry, and a faster chef would just wait faster. A bigger countertop removes those trips, which is why adding RAM sometimes helps more than a faster CPU. In the diagram, notice which trips are fast and which are slow.
The CPU: the chef
The CPU is the chip that does the computing. A program is a long list of instructions, each a tiny step such as "add these two numbers" or "copy this value to that place in memory". The CPU fetches an instruction, carries it out and moves to the next, billions of times a second.
A core is one complete chef inside the CPU, able to follow its own list of instructions. A CPU with 8 cores, for example, can work on 8 lists at once. Extra chefs help only when work can be shared out: a job that cannot be split uses one core, however many there are.
Clock speed is how fast each chef works, measured in gigahertz (GHz), billions of ticks per second. Newer cores often finish more instructions per tick than older ones, so compare clock speeds only between chips of the same family.
The CPU also keeps a little even faster memory on the chip, called cache: a nearby copy of what it used recently, kept for speed. Lesson 3 shows how many programs share a few cores.
RAM: the countertop
RAM is the computer's working memory. It holds the programs that are running and the data they are using right now, such as the page you are reading. "Random access" means the CPU can reach any spot in it about equally fast, in any order.
RAM is fast: fetching from it takes roughly 100 nanoseconds (ns), a ten-millionth of a second. Laptops commonly have 8 to 32 gigabytes (GB) of it; a gigabyte is about a billion bytes, and a byte holds about one letter of text.
RAM is also temporary: it keeps data only while it has power. That is why unsaved work can vanish in a power cut, and why saving matters: it copies your work from RAM to storage. Sleep mode keeps RAM powered, so your apps are still open when you wake the laptop.
Storage: the pantry
Storage keeps data with the power off: your files and photos, every installed program, and the operating system (OS) itself, the software that runs the computer (lesson 2).
Most new laptops use an SSD (solid-state drive): flash memory chips with no moving parts. Older machines may have an HDD (hard disk drive), with spinning magnetic platters and an arm that must move into place before it can read.
The catch is speed. An SSD needs roughly 0.1 milliseconds (ms, thousandths of a second) to fetch a small piece of data, about a thousand times longer than RAM; a hard disk needs around 10 ms. In return, storage is large and cheap. The table compares the three, with rough, illustrative figures.
| Part | CPU | RAM | Storage |
|---|---|---|---|
| Speed | Billions of steps a second | About 100 ns per fetch | SSD about 0.1 ms, hard disk about 10 ms |
| Size in a laptop | 8 cores, for example | 8 to 32 GB | 256 GB to 2 TB (a terabyte is 1,000 GB) |
| At power-off | Stops; its cache is cleared | Contents vanish | Contents kept |
How they work together
When you double-click an app, the OS finds the program on storage and copies the parts it needs into RAM, which is called loading. The CPU then fetches the program's instructions from RAM and runs them, and the window appears. In the flowchart, notice that only the first copy waits on slow storage.
This is also why an app often opens faster the second time: the OS keeps recently read files in spare RAM as a cache, skipping the trip to storage.
Why a computer slows down
A slow computer usually has a bottleneck: one part that everything else is waiting on.
- RAM is full. The operating system moves pieces of memory that have not been used lately to a reserved area of storage called swap (Windows calls it the page file). Reading them back is far slower than RAM: the countertop has overflowed, and the chef keeps walking to the pantry. A little swap is normal; constant swapping is what hurts. Close apps and tabs, or add RAM.
- The CPU is busy. One heavy program, such as a video export or a runaway browser tab, keeps the cores occupied, so everything else waits. Close it or let it finish.
- The disk is slow. A hard disk, or a disk busy with updates or backups, makes every load and save wait. Replacing a hard disk with an SSD helps most.
Check yourself
With 40 tabs open, memory is full, Swap Used keeps growing and the CPU sits at 20%. Would a faster CPU fix it?
No. The CPU is mostly waiting on swap, like a chef walking to the pantry; closing tabs or adding RAM removes those slow trips.
The power cuts while you write an unsaved essay. Why is the essay gone but the word processor still there?
The unsaved text lived only in RAM, which loses everything without power; the program is installed on storage, which keeps it.
A photo app spreads its work over every core; an old game uses one. Which gains more from 8 cores instead of 4 at the same speed?
The photo app, because its work can be shared among more chefs; the game follows one list of instructions, so only a faster core helps it.