A computer keeps data and instructions in several kinds of memory at once. They differ in four ways that questions keep returning to: speed, capacity, cost per byte and whether the contents survive a power cut (volatility). The fastest memory is the smallest and most expensive; the largest is the slowest and cheapest.

From the CPU outwards, the levels are:

  1. Registers: tiny storage on the CPU chip itself.
  2. Cache: very fast memory between the CPU and main memory.
  3. Primary memory: RAM, the working memory, plus ROM for fixed startup code.
  4. Secondary memory: hard disks, SSDs, optical discs, memory cards and pen drives.

When people talk about a computer's "memory", they usually mean primary memory. Secondary memory is more often called storage.

While the CPU processes a program, it holds the data and instructions it is working on in its own local memory, the registers. Registers are part of the CPU chip, and they are limited in both size and number. Different registers hold data, instructions or intermediate results.

Alongside the registers, the CPU has the Arithmetic Logic Unit (ALU), which does the calculations and comparisons, and the Control Unit (CU), which interprets instructions and directs the flow of data. Because registers sit inside the processor, nothing is faster to reach.

Today the whole CPU, registers included, is usually built on a single chip called a microprocessor. Microprocessors are compared by features such as word size, the maximum memory they can address and clock speed, which is why processor specifications and memory questions often appear side by side.

Programs and data are loaded into primary memory before they are processed, and the CPU reads and writes it directly. It comes in two kinds.

RAM (Random Access Memory) is the main memory. It is volatile: it keeps its contents only while power is supplied, and everything in it is wiped out when the computer is switched off. Each time you start the computer or open an application, the program and its data are loaded into RAM. RAM is faster than any secondary storage device.

ROM (Read Only Memory) is non-volatile: its contents stay when the power is off. It is a small, fast, permanent store for contents that rarely change. The classic example is the startup program, or boot loader, which loads the operating system into RAM when the computer is switched on.

A useful way to keep the pair straight: RAM is the desk you work at, cleared every evening; ROM is the printed instruction card fixed to the desk, which you read but rarely rewrite.

RAM is faster than storage but slower than the processor, so a CPU waiting on RAM would have to slow down. Cache memory solves this. It is a very high-speed memory placed between the CPU and main memory, holding copies of the data from the main-memory locations used most often.

When the CPU needs data, it looks in the cache first. If the data is there, it is read from the cache; if not, the CPU goes to main memory. This cuts the average time to fetch data, even though main memory itself is no faster.

Primary memory is limited in capacity, and RAM forgets everything at power-off. A computer therefore needs secondary (auxiliary) memory to keep data and programs permanently. Secondary memory is non-volatile, has a much larger capacity, and is slower and cheaper than main memory.

The key exam point: the CPU cannot access secondary memory directly. Contents must first be brought into main memory. Examples are hard disk drives (HDD), CDs and DVDs, memory cards, solid-state drives (SSD), which are much faster than older hard disks, and portable flash or pen drives.

Data moves between memory and the CPU over sets of wires called a bus. There are three:

  • Data bus: carries the data itself. It is bidirectional, because the CPU both reads from and writes to memory.
  • Address bus: carries the address of the memory location the CPU wants. It is unidirectional.
  • Control bus: carries read and write signals. It is unidirectional.

Together these three form the system bus. A memory controller manages the flow of data into and out of main memory.

MemoryVolatile?CPU accesses directly?Relative speedTypical use
RegistersYesYes (inside the CPU)FastestValues being processed now
CacheYesYesVery fastCopies of frequently used data
RAMYesYesFastRunning programs and open files
ROMNoYesFastStartup program (boot loader)
Secondary storageNoNoSlowestPermanent files and installed software
  • ✘ Calling ROM volatile. ROM keeps its contents without power; RAM does not.
  • ✘ Saying the CPU reads the hard disk directly. Data must reach RAM first.
  • ✘ Treating cache as extra storage space. It only holds copies of data already in main memory.
  • ✘ Calling all three buses bidirectional. Only the data bus is.

Memory sizes are measured in the units covered in memory units from bit to yottabyte. For wider revision, see computer and IT fundamentals and the computer awareness cheat code.

Q1. Which memory loses its contents when the power is switched off? easy

✅ Answer: (c) RAM

💡 Explanation: RAM is volatile: its contents are wiped out when the power supply stops. ROM, hard disks and pen drives are non-volatile.

Q2. Where is the boot loader that loads the operating system usually stored? easy

✅ Answer: (a) ROM

💡 Explanation: The startup program must survive power-off and rarely changes, so it is kept in non-volatile ROM. RAM is empty when the computer is switched on.

Q3. Which memory sits between the CPU and RAM to reduce the average access time? easy

✅ Answer: (b) Cache memory

💡 Explanation: Cache is a very high-speed memory that keeps copies of frequently used data from main memory. The CPU checks it first and goes to RAM only on a miss.

Q4. Which of these cannot be accessed directly by the CPU? medium

✅ Answer: (d) Hard disk

💡 Explanation: Secondary storage such as a hard disk must first be copied into main memory before the CPU can use it. Registers, cache and RAM are accessed directly.

Q5. Arrange from fastest to slowest: RAM, registers, hard disk, cache. medium

✅ Answer: (c) Registers, cache, RAM, hard disk

💡 Explanation: Registers are on the CPU chip itself, cache sits next to the CPU, RAM is main memory, and the hard disk is slowest secondary storage.

Q6. Which bus carries signals in both directions between the CPU and main memory? medium

✅ Answer: (b) Data bus

💡 Explanation: The CPU both reads data from and writes data to memory, so the data bus is bidirectional. The address and control buses carry signals from the CPU only.

Is cache memory primary or secondary memory?

Cache is usually grouped with primary memory because the CPU accesses it directly and it is volatile. It is not main memory, though: it holds only copies of data that already sit in RAM, to save the CPU the slower trip to main memory.

Why does a computer need RAM if it already has a hard disk or SSD?

The CPU cannot work on data stored on a disk directly. Programs and files must be loaded into RAM first, and RAM is far faster than secondary storage, so the computer stays responsive while it works.

Is a pen drive RAM or ROM?

Neither. A pen drive is secondary storage: non-volatile, removable and not accessed directly by the CPU. It uses flash memory, which keeps data without power, but in exam terms it belongs with hard disks, SSDs and memory cards.

How this page was prepared. Drafted with AI assistance (Claude (Anthropic AI model)) from the sources listed above. Automated checks also covered structure, internal links and duplicate text. Software checks cannot confirm facts. Reviewed by praveenkumar on 2026-10-29 against the sources listed above.

Found an error? Report it and we will correct the page.