Question
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, 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, ...
Assume that the cache memory is initially empty. The physical addresses of the words are given below (1 word = 1 byte).
P: 0x845B32, Q: 0x845B26, R: 0x845B36, S: 0x846B32
Which of the following statements is/are true?
Note: and
Official answer and solution
- Official answer
- A and B
- From
- Official GATE 2026 answer key
Solution
Extract the 12-bit Tag, 8-bit Cache Index, and 4-bit Block Offset from each 24-bit hex address.
With a byte direct-mapped cache and byte block size:
- Block offset: lowest bits (last hex digit).
- Cache index: next bits (the two hex digits before the last hex digit).
- Tag: upper bits (first three hex digits).
Decoding the four addresses:
- P (
0x845B32): Tag , Index , Offset - Q (
0x845B26): Tag , Index , Offset - R (
0x845B36): Tag , Index , Offset - S (
0x846B32): Tag , Index , Offset
Tracing the access loop P, Q, R, S:
- P maps to Index
B3(Tag845): on iteration 1 it is a cold miss; on iterations 2..10 it is a conflict miss because S (IndexB3, Tag846) replaced blockB3at the end of the previous iteration. Thus every access to P is a miss (A is true). - Q maps alone to Index
B2(Tag845): misses on iteration 1, and hits on iterations 2..10 (C is false). - R maps to the exact same memory block as P (Tag
845, IndexB3), which was just loaded by P in the same iteration. Thus every access to R is a cache hit (B is true). - S maps to Index
B3(Tag846), which is overwritten by P in every iteration, so every access to S is a miss (D is false).
Options (A), (B)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2026 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 52 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.