Memory management: RAM, ROM and Cache hierarchies
Memory Management: RAM, ROM and Cache Hierarchies RAM (Random Access Memory) The main memory of a computer. Stores data that is being actively used...
Memory Management: RAM, ROM and Cache Hierarchies RAM (Random Access Memory) The main memory of a computer. Stores data that is being actively used...
Memory Management: RAM, ROM and Cache Hierarchies
RAM (Random Access Memory)
The main memory of a computer.
Stores data that is being actively used by the processor.
Divided into smaller blocks called pages.
Each page is stored in a different memory chip.
Pages are swapped between RAM and ROM as needed.
Examples: text, code, photos, videos.
ROM (Read-Only Memory)
A type of non-volatile memory.
Once data is written to ROM, it cannot be changed.
Stores instructions and data that will be used during program startup.
Examples: boot sector, operating system, data that will be used by a program.
Cache
A small, fast memory that is located closer to the processor than RAM.
Cached data is frequently accessed by the processor.
The cache is organized in a similar way to RAM.
When data is requested by the processor, it is first checked in the cache.
If it is found in the cache, it is retrieved quickly.
If it is not found in the cache, it is retrieved from RAM and loaded into the cache.
Hierarchies
RAM is the highest level of memory.
ROM is below RAM.
The cache is below ROM.
The processor accesses data from the cache, then from RAM, and then from ROM as needed.
This hierarchy allows the processor to access data quickly, while still ensuring that the system has enough memory to run