An 8 KB direct-mapped write-back cache is organized as multiple blocks, each of size 32-bytes. The processor generates 32-bit addresses. The cache con

123 views
in Computer
closed

An 8 KB direct-mapped write-back cache is organized as multiple blocks, each of size 32-bytes. The processor generates 32-bit addresses. The cache controller maintains the tag information for each cache block comprising of the following.

1 Valid bit

1 Modified bit

As many bits as the minimum needed to identify the memory block mapped in the cache.

What is the total size of memory needed at the cache controller to store meta-data (tags) for the cache?

1. 4864 bits
2. 6144 bits
3. 6656 bits
4. 5376 bits

by (46.1k points)
selected

Correct Answer - Option 4 : 5376 bits

The correct answer is option 4

Data:

Main Memory size =232 Byte

Cache size = 8KB = 213 Byte

Block size = 2Byte

Valid = 1 bit

Modified = 1 bit

Formula:cachesizeblockscachesizeblocksizetotallinesl

number of bits = ⌈log2 n⌉

Number of lines in cache = $\frac{cache\;size}{block\;size}$totallineslinesinaset

MM = tag + index + block offset .....(in bits)

Total bits required to store meta-data of 1 line =  Valid bit +  Modified bit + tag bit

Calculation:

Number of cache lines =${{Cache}\ {size} \over block\ size }=\frac{2^{13}B}{2^5B}= 2^8B$

So, index bit = 8

MM = tag + index + block offset

32 = tag +8 + 5

tag =19 bits

 Tag index Block Offset 19bits 8 bits 5 bits

Total bits required to store meta-data of 1 line =  Valid bit +  Modified bit + tag bit

Total bits required to store meta-data of 1 line = 1  + 1 + 19 =21 bits

Cache memory has 256 lines

So, Total memory required =21 bits × 256 = 5376 bits