Levels of Computer Memory
Learn why a computer needs different levels of memory for executing programs.
We'll cover the following...
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:
- Disk drive to RAM
- RAM to the processor cache
- Processor cache to processor registers
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:
-
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 (
...