Discussion
A computer has 512 KB, 4-way set associative, write back data cache with block size of 32 bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit. The number of bits in the tag field of an address is :
Answer: D
The tag field has 15 bits.
The cache holds \(512 \text{ KB} = 2^{19}\) bytes in blocks of \(32 = 2^{5}\) bytes. Work out the offset and index fields first:
\[ \begin{aligned} \text{blocks} &= 2^{19} / 2^{5} = 2^{14} \\ \text{sets} &= 2^{14} / 4 = 2^{12} \\ \text{offset} &= \log_2 32 = 5 \text{ bits} \\ \text{index} &= 12 \text{ bits} \\ \text{tag} &= 32 - 12 - 5 = 15 \text{ bits} \end{aligned} \]
The valid, modified and replacement bits are stored in the tag directory entry alongside the tag; they are not part of the address, so they do not change the tag field. 32 is the whole address, and 80 and 64 are not field sizes for a 32-bit address.
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