A cache memory unit with capacity of \(N\) words and block size of \(B\) words…

2017

A cache memory unit with capacity of \(N\) words and block size of \(B\) words is to be designed. If it is designed as a direct mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as a 16-way set-associative cache, the length of the TAG field is ____________ bits.

Attempted by 113 students.

Show answer & explanation

Correct answer: 14

Key idea: the total address bits and the block offset stay the same, so changing from direct-mapped to 16-way set-associative reduces the number of index bits by log2(16)=4, increasing the tag by the same amount.

  • For the direct-mapped cache: number of sets = N/B, so index bits = log2(N/B). Block offset bits = log2(B).

  • For the 16-way set-associative cache: number of sets = (N/B)/16, so index bits = log2(N/B) − log2(16) = log2(N/B) − 4.

  • Since address size and block offset are unchanged, the tag length increases by 4 bits.

Therefore, new tag length = 10 + 4 = 14 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