Machine-translated by Google. Questions are authored in English.
Top

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 :

  • A.80
  • B.32
  • C.64
  • D.15

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.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.