An 8KB direct-mapped write-back cache is organized as multiple blocks, each…

2011

An 8KB direct-mapped write-back cache is organized as multiple blocks, each size of 32-bytes. The processor generates 32-bit addresses. The cache controller contains 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. A.

    4864 bits

  2. B.

    6144 bits

  3. C.

    6656 bits

  4. D.

    5376 bits

Attempted by 263 students.

Show answer & explanation

Correct answer: D

Solution:

  1. Compute sizes: Cache size = 8 KB = 8192 bytes. Block size = 32 bytes.

  2. Number of blocks (lines) = 8192 / 32 = 256.

  3. Offset bits = log2(block size) = log2(32) = 5 bits.

  4. Index bits = log2(number of lines) = log2(256) = 8 bits.

  5. Tag bits = address bits - index bits - offset bits = 32 - 8 - 5 = 19 bits.

  6. Metadata per block = tag bits + valid bit + modified bit = 19 + 1 + 1 = 21 bits.

  7. Total metadata = number of blocks × metadata per block = 256 × 21 = 5376 bits.

Answer: 5376 bits

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir