A 16-way set-associative cache memory has a total capacity of 16 MB and is…

A 16-way set-associative cache memory has a total capacity of 16 MB and is organized into 64-byte blocks.

The system uses a 36-bit physical address to access data. For each cache line, the cache controller stores a tag that includes the tag bits derived from the physical address plus 1 valid bit, 1 update bit, and 2 replacement bits.

Determine the following parameters:

  1. The size of the tag field in one cache line (in bits), denoted as x.

  2. The total size of the tag directory (in kilobits), denoted as y.

  3. The overall size of the cache, including both data and tag storage (in MB), denoted as z.

Compute the value of x + y + z.

Answer: 5156.625Given: Total cache data capacity = 16 MB Block size = 64 bytes (offset = 6 bits) Associativity = 16 (16-way) Physical address = 36 bits Per-line extra bits in…

Attempted by 9 students.

Show answer & explanation

Correct answer: 5156.625

Given:

  • Total cache data capacity = 16 MB

  • Block size = 64 bytes (offset = 6 bits)

  • Associativity = 16 (16-way)

  • Physical address = 36 bits

  • Per-line extra bits in tag directory: 1 valid bit, 1 update bit, 2 replacement bits (total 4 extra bits)

Step-by-step calculation:

  • Number of blocks = (16 MB) / (64 B) = (16 * 2^20) / 2^6 = 2^18 = 262,144 blocks

  • Number of sets = blocks / associativity = 262,144 / 16 = 16,384 = 2^14 sets

  • Index bits = log2(number of sets) = 14 bits

  • Offset bits = log2(block size) = 6 bits

  • Tag bits derived from address = 36 - index bits - offset bits = 36 - 14 - 6 = 16 bits

  • Size of the tag field in one cache line (including the 4 extra bits) = 16 + 4 = 20 bits

  • Total number of cache lines = number of blocks = 262,144

  • Total tag bits = 262,144 lines * 20 bits/line = 5,242,880 bits

  • Total tag directory in kilobits = 5,242,880 / 1024 = 5,120 kilobits

  • Tag storage in bytes = 5,242,880 / 8 = 655,360 bytes = 0.625 MB

  • Overall cache size (data + tags) = 16 MB + 0.625 MB = 16.625 MB

Final numeric values:

  • x (tag field size per line) = 20 bits

  • y (total tag directory) = 5,120 kilobits

  • z (overall cache size) = 16.625 MB

Therefore x + y + z = 20 + 5,120 + 16.625 = 5,156.625 (numeric sum of the three values with their stated units).

Note: The provided answer range (5152–5153) suggests a different interpretation (for example, counting only the 16 tag bits for x and/or treating the reported overall size differently). The solution above states the most direct interpretation of the problem statement: x includes the 4 extra control bits, y is the full tag directory in kilobits, and z is total cache size in MB including tag storage.

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

Explore the full course: Zero To Hero

Loading lesson…