Consider a machine with a byte addressable main memory of 2^32 bytes divided…

2017

Consider a machine with a byte addressable main memory of 2^32 bytes divided into blocks of size 32 bytes. Assume that a direct mapped cache having 512 cache lines is used with this machine. The size of the tag field in bits is _______

Attempted by 303 students.

Show answer & explanation

Correct answer: 18

Answer: 18 bits.

Explanation:

  • Total physical address size is 32 bits (2^32 bytes of memory).

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

  • Index bits = log2(number of cache lines) = log2(512) = 9 bits.

  • Tag bits = address bits − (index bits + offset bits) = 32 − (9 + 5) = 18 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