Memory hierarchy refers to the structured arrangement of storage types in a computer system, ranging from fastest and smallest (registers, cache) to slower and larger (RAM, hard drives). Caching concepts involve storing frequently accessed data in faster memory (cache) to reduce access time and improve performance. This hierarchy optimizes cost, speed, and efficiency by ensuring that the most critical data is quickly accessible while less-used data resides in slower, larger storage.
Memory hierarchy refers to the structured arrangement of storage types in a computer system, ranging from fastest and smallest (registers, cache) to slower and larger (RAM, hard drives). Caching concepts involve storing frequently accessed data in faster memory (cache) to reduce access time and improve performance. This hierarchy optimizes cost, speed, and efficiency by ensuring that the most critical data is quickly accessible while less-used data resides in slower, larger storage.
What is memory hierarchy in computer architecture?
An organized stack of storage levels (registers, L1/L2/L3 caches, main memory, disk) with increasing size and latency. Data moves from fast, small levels to slower, larger ones to optimize speed and cost.
What is a cache and why is it important?
A small, fast storage near the CPU that stores recently used data and instructions to dramatically reduce average memory access time.
What are cache hits and cache misses?
A cache hit means the requested data is in the cache; a miss means it's not and must be fetched from a lower level, possibly updating the cache.
What are cache mapping and associativity?
Mapping determines where memory blocks can reside in the cache: direct-mapped, fully associative, or set-associative. Higher associativity offers flexibility but adds hardware complexity.
What are temporal and spatial locality?
Temporal locality: recently accessed data is likely to be reused soon. Spatial locality: data near recently accessed items is likely to be used soon, guiding prefetching and caching decisions.