...

/

Levels of Computer Memory

Levels of Computer Memory

Learn why a computer needs different levels of memory for executing programs.

Why the OS loads instructions into the RAM

In theory, the CPU can read program instructions directly from the disk drive. However, this never actually happens. Instead, the OS loads the instruction into RAM first. Then, the processor executes them. Why does this happen?

A modern computer has four levels in the memory hierarchy. Each level matches the red rectangle, as shown in the figure on the right. Each rectangle matches a separate device. The only exception is the CPU chip, which contains both registers and a memory cache. Those are separate modules of the chip.

The arrows in the figure represent data flows. Data transfer occurs only between adjacent memory levels. The processor works with data from its registers only. If the CPU needs something from the disk drive, it’s loaded in the following way:

  1. Disk drive to RAM
  2. RAM to the processor cache
  3. Processor cache to processor registers
Memory hierarchy

When the CPU writes data back to the disk, it does so in reverse order of the steps above.

The memory levels differ from each other by the following parameters:

  1. Access speed defines the amount of data we can read or write to the device per unit of time. Its units of measure are bytes per second ( ...

Access this course and 1400+ top-rated courses and projects.