Consider a computer system with a byte-addressable primary memory of size 232…

2021

Consider a computer system with a byte-addressable primary memory of size 232 bytes. Assume the computer system has a direct-mapped cache of size 32 KB (1 KB = 210 bytes), and each cache block is of size 64 bytes.

The size of the tag field is ________ bits.

Attempted by 303 students.

Show answer & explanation

Correct answer: 17

Key idea: the physical address is 32 bits because the memory size is 2^32 bytes.

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

  • Number of cache lines = cache size / block size = 32 KB / 64 B = 32768 / 64 = 512.

  • Index bits = log2(512) = 9 bits.

  • Tag bits = address bits - index bits - offset bits = 32 - 9 - 6 = 17 bits.

Answer: 17 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