GATE Computer ScienceEasyGATE CS (PYQ pattern)
A loop executes `for (i = 0; i < n; i++) sum += a[i];` with a large array a. Which memory access pattern shows strong spatial locality but essentially no temporal locality?
- A. Repeated fetches of the loop's instructions
- B. Repeated use of the variable i
- C. Successive reads of a[i]
- D. Repeated updates of sum
Correct answer: C. Successive reads of a[i]
Each element is used once, but neighbouring elements share cache blocks (spatial). sum, i and the loop body are reused every iteration (temporal).
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- An instruction mix is: ALU 45% (CPI 1), loads 25% (CPI 2), stores 10% (CPI 2), branches 20% (CPI 3). A compiler optimisation deletes one…
- How many distinct finite non-zero IEEE 754 single-precision numbers x satisfy 1 ≤ x < 4?
- An 8-bit ALU computes 0x50 − 0xB0 by adding 0x50 to the two's complement of 0xB0. What are the result and the signed-overflow flag V?
- A processor has a 64-entry fully associative TLB, 4 KB pages, and a data cache of 512 KB. A program sweeps through an array of 1 MB…
- A 32 KB cache with 64-byte blocks and 36-bit physical addresses is 4-way set-associative. If the associativity is doubled (8-way) while…
- A stack machine evaluates the sum of 16 distinct variables arranged as a perfectly balanced binary tree of additions (addition is…