A 4-way set-associative cache memory unit with a capacity of 16 KB is built…

2014

A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is _____.

Attempted by 187 students.

Show answer & explanation

Correct answer: 20

Key facts: use these to compute the tag field size.

  • Word length = 32 bits → 4 bytes per word.

  • Block size = 8 words = 8 × 4 bytes = 32 bytes.

  • Block offset bits = log2(32) = 5 bits.

  • Cache capacity = 16 KB = 16 × 1024 = 16384 bytes, so number of blocks = 16384 / 32 = 512 blocks.

  • 4-way set-associative → number of sets = 512 / 4 = 128 sets → index bits = log2(128) = 7 bits.

  • Physical address space = 4 GB = 2^32 bytes → physical address bits = 32.

  • Tag bits = physical address bits − index bits − offset bits = 32 − 7 − 5 = 20 bits.

Answer: Number of TAG bits = 20.

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

Explore the full course: Gate Guidance By Sanchit Sir