Skip to content

1.2.1 Primary storage (memory)

GCSE · Paper 1 · Computer systems · Section 1.2 · 15 flashcards · 9 practice questions

Questions

1.2.1 Primary storage (memory)

A computer needs somewhere to keep the programs and data it is working on right now. That place is called primary storage. It is also called primary memory or main memory.

Definition
Primary storage is memory that the CPU can read from and write to directly. It holds the instructions and data the computer is using at the moment.

Why a computer needs primary storage

The CPU can only work on instructions and data that are in primary storage. It cannot run a program straight from a hard drive or a memory stick.

When you open a game, the computer copies it from secondary storage into primary storage. Then the CPU fetches the instructions from there, one at a time, and carries them out.

Primary storage is used because it is much faster than secondary storage. If the CPU had to wait for a slow device every time it needed an instruction, the whole computer would crawl.

Key Point
The CPU cannot use anything directly from secondary storage. Programs and data must be loaded into primary storage first. Primary storage is fast, but it is small compared with secondary storage.

The main types of primary storage are RAM and ROM. Computers also use virtual memory and cache to help them run well.

RAM

Definition
RAM stands for random access memory. It is the computer's main working memory. It holds the programs, the operating system and the data that are in use right now.

The key characteristics of RAM are:

  • •
    It is volatile. When the power is turned off, everything in RAM is lost.
  • •
    You can read from it and write to it. Its contents change all the time.
  • •
    It is fast, and it can be added to or upgraded (for example 8 GB or 16 GB).
  • •
    Any location can be reached quickly. That is what "random access" means.
When you save a document, the computer copies it from RAM to secondary storage. If you do not save, and the power goes off, the work in RAM is gone.
Warning
Do not say that RAM "stores files". Files are stored in secondary storage. RAM only holds what is in use at the moment.

ROM

Definition
ROM stands for read only memory. It holds instructions that must not be lost or changed, such as the instructions a computer uses to start up.

The key characteristics of ROM are:

  • •
    It is non-volatile. The contents stay when the power is off.
  • •
    It is read only. The computer can read it, but normally cannot change it.
  • •
    It is small, because it only holds a few essential instructions.
The most important thing ROM holds is the boot program (also called the bootstrap). When you switch on, RAM is empty. The CPU needs somewhere to find its first instructions. It finds them in ROM. The boot program starts the computer and loads the operating system from secondary storage into RAM.

Many devices also keep fixed instructions in ROM. Examples are a washing machine, a microwave or a TV remote.

RAM and ROM compared

RAMROM
Volatile?Volatile: contents lost when power is offNon-volatile: contents kept when power is off
Read and write?Can be read and writtenRead only (normally cannot be changed)
What it holdsPrograms and data in use right nowStart-up (boot) instructions
SizeLarge (gigabytes)Small
Contents change?All the timeRarely or never
Exam Tip
A common question is "why is the boot program stored in ROM and not in RAM?" The answer is that RAM is volatile. It is empty when the computer is switched on. ROM keeps its contents with the power off, so the start-up instructions are always there.

Virtual memory

RAM is limited. If you open many programs at once, the RAM can fill up. The computer could stop working. Instead, it uses virtual memory.

Definition
Virtual memory is part of the secondary storage (for example, part of the hard drive) that the computer uses as if it were extra RAM when the real RAM is full.

How virtual memory works

  • 1.
    The RAM becomes full.
  • 2.
    The computer picks some data in RAM that is not being used right now.
  • 3.
    It moves that data from RAM to a space on the secondary storage.
  • 4.
    This frees up space in RAM for the program or data that is needed.
  • 5.
    Later, if the moved data is needed again, it is moved back into RAM. Something else may be moved out to make room.
Key Point
Virtual memory lets a computer run more programs than would fit in RAM alone. But secondary storage is much slower than RAM, so the computer becomes slower when it relies on virtual memory.

The best fix for a computer that is slow because it keeps using virtual memory is to fit more RAM. Then less data needs to be moved to and from secondary storage.

Cache

Definition
Cache is a small amount of very fast memory, on or very close to the CPU. It stores the instructions and data that the CPU uses most often.

The CPU is much faster than RAM. Without cache, the CPU would often have to wait for RAM. The cache keeps a copy of the instructions and data that are used again and again, such as the instructions in a loop. When the CPU needs them, it finds them in the cache and does not have to wait.

The key characteristics of cache are:

  • •
    It is faster than RAM.
  • •
    It is much smaller than RAM (usually a few megabytes, compared with gigabytes of RAM).
  • •
    It costs more per gigabyte than RAM, which is why there is not more of it.
  • •
    A bigger cache usually means a faster computer, because the CPU finds what it needs in the cache more often.
Pros & Cons
Advantages of a larger cacheDisadvantages of a larger cache
The CPU waits less for instructions and dataIt costs more
Programs usually run fasterIt is still small compared with RAM

The memory in order of speed

MemorySpeedSize
CacheFastestSmallest
RAMFastLarge
Virtual memory (on secondary storage)SlowDepends on the free space

Keep these apart

Remember
- RAM: working memory, volatile, read and write.
- ROM: start-up instructions, non-volatile, read only.
- Virtual memory: part of secondary storage used as extra RAM when RAM is full. It is slower than RAM.
- Cache: small, very fast memory next to the CPU for the instructions and data used most.

Exam technique

  • •
    State and give questions need a short fact: "ROM is non-volatile" or "cache is faster than RAM".
  • •
    Describe questions need you to say what something does or how it works. For virtual memory, describe the movement of data between RAM and secondary storage.
  • •
    Explain questions need a reason as well. Write "because" and join two points: "RAM is volatile, so the boot program is kept in ROM".
  • •
    For a compare question, always give a point about both items. Do not only say "RAM is volatile". Say "RAM is volatile but ROM is non-volatile".
  • •
    Use the correct words: volatile, non-volatile, read only, boot program. Do not call ROM "permanent storage" or say that RAM "stores files".