Understanding Memory Hierarchy
Understanding Memory Hierarchy
Hierarchy
Exploring the different types of computer memory and how they
are organized and accessed is crucial for efficient system design
and performance.
Magnetic storage devices with large capacity but Use flash memory for faster data access and retrieval
slower access times. compared to HDDs.
Mapping Methods
Direct Mapping Set Associative Mapping
A simple one-to-one correspondence between memory A compromise between direct and associative, with multiple
addresses and cache locations. ways per set.
1 2 3
Associative Mapping
Allows any cache line to store data from any memory address.
Direct Mapping
Simple Limited Flexibility
Implementation
Data can only be stored in a
Direct mapping has a specific cache line, leading
straightforward one-to-one to potential conflicts.
relationship between
memory addresses and
cache locations.
Associative Mapping
Flexible Complex
Data can be stored in any Requires more complicated
cache line, improving hit rates. hardware for searching the
entire cache.
Set Associative Mapping
Compromise
Set associative mapping balances simplicity and flexibility.
Multiple Ways
Data can be stored in any of the multiple cache lines
within a set.
Reduced Complexity
Searching is limited to the cache lines within a set.
Mapping Pros and Cons
Direct Mapping Simple, fast, but limited
flexibility