According to the principle of locality of reference, which hardware feature is most directly justified for improving average memory-access performance?

Difficulty: Easy

Correct Answer: Cache memory

Explanation:


Introduction / Context:
Programs tend to access a relatively small subset of instructions and data repeatedly over short intervals. This statistical behavior—temporal and spatial locality—drives architectural optimizations that reduce effective memory latency and increase throughput.


Given Data / Assumptions:

  • Temporal locality: recently accessed items are likely to be accessed again.
  • Spatial locality: nearby items are likely to be accessed soon.
  • Hardware can exploit locality by storing hot data closer to the CPU.


Concept / Approach:
Cache memory is a small, fast memory that holds recently used lines from main memory. Because locality concentrates accesses, a cache achieves a high hit rate and lowers average access time. Virtual memory also benefits from locality but is primarily a capacity and protection mechanism; cache is the direct performance manifestation of locality at the hardware level.


Step-by-Step Solution:

1) Identify locality patterns in typical workloads.2) Place a small, fast cache between CPU and RAM.3) On hits, serve data from cache; on misses, fetch from RAM and fill cache line.4) Overall effect: reduced average memory access time due to frequent hits.


Verification / Alternative check:
Profiling shows most accesses hit in L1/L2/L3 caches, dramatically reducing cycles per access compared to DRAM latency.


Why Other Options Are Wrong:

  • Virtual memory: Uses paging; justified partly by locality but focuses on address-space abstraction, not direct hardware speedup.
  • Reenterable / Non reusable: Not relevant to locality-driven hardware caching.
  • None of the above: Incorrect because cache memory is directly justified.


Common Pitfalls:
Assuming virtual memory alone speeds access; it can add overhead on page faults. Cache directly targets access time using locality.


Final Answer:
Cache memory

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion