About Lesson
Memory hierarchy refers to the arrangement of different types of memory in a system, organized by speed and size. The goal is to provide the processor with fast access to data while keeping the overall cost of memory systems low.
Types of Memory:
- Registers: The fastest memory, located within the CPU, used to store immediate data and instructions.
- Cache Memory: A small amount of very fast memory located close to the CPU. Cache stores frequently accessed data and instructions to reduce the time spent fetching them from slower memory.
- Main Memory (RAM): Primary storage used to store data and instructions that are actively in use by the processor. It is slower than cache memory.
- Secondary Storage: Long-term storage devices like hard drives or SSDs, used to store large amounts of data persistently.
Memory Management:
- Memory Allocation: The process of assigning memory space to running programs.
- Paging: A memory management scheme that eliminates the need for contiguous memory allocation, dividing memory into fixed-size blocks.
Segmentation: Divides memory into segments based on the type of data (e.g., code, data, stack).