Reading history

Computer Memory and Storage

4 min read 2 views

Bits and bytes, RAM, ROM and cache, hard disks, SSDs, pen drives and cloud storage, and the memory hierarchy, with worked examples.

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.

UnitSizeRoughly holds
1 byte (B)8 bitsOne character, such as “A”
1 kilobyte (KB)1024 bytesA short paragraph
1 megabyte (MB)1024 KBA one-minute MP3 song
1 gigabyte (GB)1024 MBAbout an hour of standard-quality video
1 terabyte (TB)1024 GBHundreds 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

DeviceHow it worksStrengthsWeaknesses
Hard disk drive (HDD)Magnetic spinning plattersLarge and cheapSlower; can break if dropped
Solid state drive (SSD)Flash memory chips, no moving partsVery fast, silent, toughCosts more per GB
Pen drive / memory cardFlash memorySmall and portableEasy to lose; can carry viruses
Optical disc (CD, DVD, Blu-ray)Laser reads tiny pitsCheap for sharingSmall capacity; now rarely used
Cloud storageFiles kept on internet serversReach from any device; safe from local lossNeeds internet; privacy concerns

The Memory Hierarchy

RegistersCacheRAMSSDHDD / cloudfastercostlier per GBlargercheaper per GB

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

  1. Saying a phone has “128 GB RAM”. 128 GB is usually storage; RAM is typically 4 to 12 GB.
  2. Thinking ROM is a kind of storage for your files. ROM holds fixed system instructions only.
  3. Mixing up bits and bytes. Internet speed in Mbps is megabits; file size in MB is megabytes, eight times larger.
  4. 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.

Next: Number Systems: Binary, Octal and Hexadecimal.

Lessons are also marked complete when you click Next.

Leave a Reply

Your email address will not be published. Required fields are marked *