Question
For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block.
Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2025 answer key
Solution
Sum the tag, index, and byte-offset bits to find the main memory size, and multiply the number of cache lines () by the block size ( byte) for the cache size.
- Since the cache block size is in a byte-addressable system, the block offset field requires .
- Total physical address length .
- Main memory size .
- Number of cache blocks , each of size (with no extra tag/status bits stored per the problem statement, or counting data capacity):
- Cache memory size .
Option (A)
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 39 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.