What term describes the memory locality principle where if a memory location is accessed, nearby memory locations are likely to be accessed soon (such as in sequential array loops)?

Answer and explanation

Correct answer: A. Spatial locality

  1. Step 1: Programs exhibit predictable execution locality patterns that enable hardware caching to achieve high hit rates.
  2. Step 2: Spatial locality observed during sequential code execution and contiguous array processing is exploited by caching multi-byte cache lines (e.g., 64 bytes) whenever a single byte is referenced.
Answer
Spatial locality
Why not the others: 'Temporal locality' Temporal locality states that a specific memory address accessed recently is likely to be accessed again soon (such as loop index variables); 'Associative locality' Associativity refers to cache indexing structure (direct-mapped vs set-associative), not a program behavioral locality principle; 'Virtual locality' Virtual memory maps logical pages to physical frames, but does not describe the spatial clustering of memory references.

Practise more Computer Architecture and Hardware.

Free questions with an explanation for every one, and full timed General Knowledge mock tests.