A four-set associative cache-memory system consists of 32 blocks of cache. Each block holds 256 bytes of data. Each block includes a control field with two LRU bits, a valid bit and a dirty bit. The address space is 4 gigabytes. Calculate the total size of the cache, including all control, data and tag bits.

Respuesta :

Answer: total size of cache = 66, 336bits= 8,292B.

Control bits = 4b.

Offset=8bits

Index=3bits

Tag= 21bits

Explanation: total $ size of cache = data + control bits+ tag.

For each block: control bit = LRU bit + valid bit+ dirty bits = 2 +1 + 1 = 4b.

Address = tag + index + offset ; 256 =2 raised to power of 8, then offset = 8.

Number of blocks in each direct mapped cache=32/4 = 2raised to power 3, index = 3.

Tag = 32 - 8- 3 = 21bits.

Total size = 32 blocks × (4bits + 22bits + 256 bits × 8 bits) = 66,336bits = 8,292B.