Memory Mappings in Cache
Architecture
Direct, Associative, and Set-
Associative Mapping
Your Name | Date | Course Info
Introduction
• Why Memory Mapping?
• - Improves access speed between CPU and
main memory.
• - Determines how cache memory stores and
retrieves data.
What is Cache Memory?
• Cache is a fast, small memory close to the
CPU.
• It stores copies of frequently accessed data.
• Memory mapping determines where data is
stored in the cache.
Direct Mapping
• Definition: Each block of memory maps to only
one possible cache line.
• Formula: Cache index = (Block address) MOD
(Number of lines)
• Pros: Simple, fast
• Cons: High conflict rate
Associative Mapping
• Definition: Any block can go into any cache
line.
• Search Method: Entire cache is searched using
tags.
• Pros: No conflict misses
• Cons: Slower and complex
Set-Associative Mapping
• Definition: Cache is divided into sets with
multiple lines each.
• k-way Set Associative: A block maps to one set
and any line in it.
• Pros: Balanced approach
• Cons: Moderately complex
Comparison Table
• Feature | Direct | Associative | Set-
Associative
• ------------------|------------|-------------|--------------
---
• Speed | Fastest | Slowest |
Moderate
• Flexibility | Low | High | Moderate
• Complexity | Low | High | Medium
• Conflict Miss | High | None | Low
Real World Use
• - Direct Mapping: Embedded systems
• - Associative Mapping: Research and
performance-critical parts
• - Set-Associative Mapping: Most modern CPUs
Conclusion
• - Mapping strategy depends on system needs
• - Set-Associative provides best balance
• - Critical for efficient cache utilization

Memory Mappings Presentation | Cache Memory | Irfan Rehman

  • 1.
    Memory Mappings inCache Architecture Direct, Associative, and Set- Associative Mapping Your Name | Date | Course Info
  • 2.
    Introduction • Why MemoryMapping? • - Improves access speed between CPU and main memory. • - Determines how cache memory stores and retrieves data.
  • 3.
    What is CacheMemory? • Cache is a fast, small memory close to the CPU. • It stores copies of frequently accessed data. • Memory mapping determines where data is stored in the cache.
  • 4.
    Direct Mapping • Definition:Each block of memory maps to only one possible cache line. • Formula: Cache index = (Block address) MOD (Number of lines) • Pros: Simple, fast • Cons: High conflict rate
  • 5.
    Associative Mapping • Definition:Any block can go into any cache line. • Search Method: Entire cache is searched using tags. • Pros: No conflict misses • Cons: Slower and complex
  • 6.
    Set-Associative Mapping • Definition:Cache is divided into sets with multiple lines each. • k-way Set Associative: A block maps to one set and any line in it. • Pros: Balanced approach • Cons: Moderately complex
  • 7.
    Comparison Table • Feature| Direct | Associative | Set- Associative • ------------------|------------|-------------|-------------- --- • Speed | Fastest | Slowest | Moderate • Flexibility | Low | High | Moderate • Complexity | Low | High | Medium • Conflict Miss | High | None | Low
  • 8.
    Real World Use •- Direct Mapping: Embedded systems • - Associative Mapping: Research and performance-critical parts • - Set-Associative Mapping: Most modern CPUs
  • 9.
    Conclusion • - Mappingstrategy depends on system needs • - Set-Associative provides best balance • - Critical for efficient cache utilization