Skip to main content

GATE CSE 2026CO & Architecture › Memory Hierarchy & Cache OrganizationVerified

GATE CSE 2026 PYQ: Consider a system with a processor and a 4 4 4 KB direct mapped cache with block size of 16 16 16 bytes. The…

Consider a system with a processor and a 4 KB direct mapped cache with block size of 16 bytes. The system has a 16 MB physical memory. Four words P,Q,R\mathrm{P}, \mathrm{Q}, \mathrm{R}, and S are accessed by the processor in the same order 10 times. That is, there are a total of 40 memory references in the sequence P,Q,R,S,P,Q,R,S,…\mathrm{P}, \mathrm{Q}, \mathrm{R}, \mathrm{S}, \mathrm{P}, \mathrm{Q}, \mathrm{R}, \mathrm{S}, \ldots


Assume that the cache memory is initially empty. The physical addresses of the words are given below (1 word =1=1 byte).

P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32\text{P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32}

Which of the following statements is/are true?
Note: 1 K=2101 \mathrm{~K}=2^{10} and 1M=2201 \mathrm{M}=2^{20}

  1. A
    Every access to P\text{P} results in a cache miss
    Correct answer
  2. B
    Every access to R\text{R} results in a cache hit
    Correct answer
  3. C
    Every access to Q\text{Q} results in a cache miss
  4. D
    Except the first access to S\text{S}, all subsequent accesses to S\text{S} result in cache hits

Answer

(A, B) Every access to P \text{P} P results in a cache miss; Every access to R \text{R} R results in a cache hit

Approach

Use the direct-mapped cache split: 4 KB cache with 16-byte blocks gives 256 lines. The lowest 4 address bits are block offset, next 8 bits are index, and remaining upper bits are tag. Compute the block tag/index for P, Q, R, S, then simulate the repeated access sequence P, Q, R, S ten times.

P and R share the same cache block, with P reloading it just before each R access, so P always misses and R always hits. Q has its own cache index and misses only once. S conflicts with P/R on index 0xB3 and is evicted every iteration, so it never hits after the first. Therefore only A and B are true.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.