Discussion
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?
Answer: A
The sizes are 64 KB of main memory and 4 KB of cache.
With one-byte blocks there is no offset field, so the address consists of the tag and the index only:
\[ \begin{aligned} \text{address bits} &= 4 + 12 = 16 \\ \text{main memory} &= 2^{16}\ \text{B} = 64\ \text{KB} \\ \text{cache} &= 2^{12} \times 1\ \text{B} = 4\ \text{KB} \end{aligned} \]
The cache has one block per index value, 212 blocks of one byte each, and the question says nothing else (tags or valid bits) is counted. 128 KB would need a 17-bit address, and caches of 8 KB, 16 KB or 6 KB do not match a 12-bit index with one-byte blocks.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development