When you open a file, the computer copies it from storage into memory so the processor can work on it quickly. When you save, it copies the changes back. Computers use several kinds of memory, each with a different balance of speed, size and cost. This lesson explains primary and secondary memory, RAM and ROM, cache, storage devices, and the units used to measure data, from bits to terabytes.
In this lesson you will learn
- Bits, bytes and the units of storage
- Primary memory: RAM, ROM and cache
- Secondary storage: HDD, SSD, flash drives, optical discs and the cloud
- The memory hierarchy: speed versus size versus cost
- Volatile and non-volatile memory
You should know the main hardware components.
Measuring Data
A computer stores everything as 0s and 1s. One 0 or 1 is a bit (binary digit). Eight bits make a byte, which is enough to store one English letter.
| Unit | Size | Roughly holds |
|---|---|---|
| 1 byte (B) | 8 bits | One character, such as “A” |
| 1 kilobyte (KB) | 1024 bytes | A short paragraph |
| 1 megabyte (MB) | 1024 KB | A one-minute MP3 song |
| 1 gigabyte (GB) | 1024 MB | About an hour of standard-quality video |
| 1 terabyte (TB) | 1024 GB | Hundreds of thousands of photos |
How many photos of 4 MB each fit on a 16 GB pen drive?
16 GB = 16 × 1024 MB = 16384 MB
16384 ÷ 4 = 4096 photos
Drive makers often count 1 GB as 1000 MB, so a “500 GB” drive shows as about 465 GB in your computer. Both are correct; they just use different units.
Primary Memory
Primary memory is directly accessed by the CPU.
- RAM (random access memory) holds the programs and data in use right now. It can be read and written. It is volatile: everything in it is lost when the power goes off, which is why unsaved work disappears in a power cut.
- ROM (read-only memory) holds permanent instructions, such as the start-up program (BIOS or UEFI) that checks the hardware when you switch on. It is non-volatile.
- Cache is a small, extremely fast memory inside or next to the CPU. It keeps copies of the data the CPU uses most often so it does not have to wait for RAM.
Secondary Storage
| Device | How it works | Strengths | Weaknesses |
|---|---|---|---|
| Hard disk drive (HDD) | Magnetic spinning platters | Large and cheap | Slower; can break if dropped |
| Solid state drive (SSD) | Flash memory chips, no moving parts | Very fast, silent, tough | Costs more per GB |
| Pen drive / memory card | Flash memory | Small and portable | Easy to lose; can carry viruses |
| Optical disc (CD, DVD, Blu-ray) | Laser reads tiny pits | Cheap for sharing | Small capacity; now rarely used |
| Cloud storage | Files kept on internet servers | Reach from any device; safe from local loss | Needs internet; privacy concerns |
The Memory Hierarchy
No single memory is fast, large and cheap all at once. So computers combine them: a tiny amount of very fast registers and cache, a medium amount of RAM, and a large amount of cheaper storage. The faster the memory, the more it costs per byte and the less of it there is.
Common Mistakes
- Saying a phone has “128 GB RAM”. 128 GB is usually storage; RAM is typically 4 to 12 GB.
- Thinking ROM is a kind of storage for your files. ROM holds fixed system instructions only.
- Mixing up bits and bytes. Internet speed in Mbps is megabits; file size in MB is megabytes, eight times larger.
- Forgetting RAM is volatile. Save your work often.
Practice Exercises
Exercise 1. A 100 Mbps internet line downloads at best how many megabytes per second?
Show answer
100 ÷ 8 = 12.5 MB per second, because 1 byte = 8 bits.
Exercise 2. Arrange from fastest to slowest: RAM, HDD, cache, SSD.
Show answer
Cache, RAM, SSD, HDD.
Frequently Asked Questions
Will adding more RAM make my computer faster?
Only if you often run out of RAM, for example with many browser tabs open. When RAM fills up, the computer uses slow storage as extra memory, so more RAM helps. If RAM is not full, adding more changes little.
What is virtual memory?
It is part of the storage drive that the operating system uses as extra RAM when real RAM runs out. It lets more programs run, but it is much slower than real RAM.
Summary
- 8 bits = 1 byte; 1024 bytes = 1 KB, and so on up to GB and TB.
- RAM is fast but volatile; ROM is permanent; cache is the fastest.
- HDDs are cheap and large; SSDs are fast; the cloud is reachable anywhere.
- Faster memory costs more, so computers use a hierarchy.
