A computer processor sends 32 bits address to cache controller it has ...
Size of Cache Tag Directory
Given:
- Processor sends 32 bits address to cache controller
- Cache size = 512 kbyte
- 8 way set associative write back data cache
- Block size = 32 bytes
- Each cache tag directory entry contains 3 valid bits and 1 modified bit
Explanation:
The cache tag directory is used to store the tag values of the cache blocks. Each cache block is a part of the main memory and is identified by its tag value. The tag value is a part of the memory address that is sent by the processor to the cache controller.
The cache is 8 way set associative, which means that each set in the cache has 8 cache blocks. The cache block size is 32 bytes, which means that each cache block can store 32 bytes of data.
The cache tag directory entry contains 3 valid bits and 1 modified bit. The valid bits indicate whether the cache block is currently storing valid data or not. The modified bit indicates whether the cache block has been modified and needs to be written back to the main memory.
To calculate the size of the cache tag directory, we need to calculate the number of cache blocks in the cache and the number of cache sets in the cache. The number of cache blocks can be calculated as:
Number of cache blocks = Cache size / Block size
Number of cache blocks = 512 kbyte / 32 bytes
Number of cache blocks = 16384
Since the cache is 8 way set associative, the number of cache sets can be calculated as:
Number of cache sets = Number of cache blocks / Associativity
Number of cache sets = 16384 / 8
Number of cache sets = 2048
Since each cache tag directory entry contains 4 bits (3 valid bits and 1 modified bit), the size of the cache tag directory can be calculated as:
Size of cache tag directory = Number of cache sets * Number of cache blocks per set * Size of each cache tag directory entry
Size of cache tag directory = 2048 * 8 * 4 bits
Size of cache tag directory = 65536 bits
Size of cache tag directory = 8 kbytes
Conclusion:
The size of the cache tag directory is 8 kbytes.