The GATE Grind

GATE 2023 CS – Question 64

Computer Organization and Architecture · Memory Interfacing and Hierarchy · 2 marks · Numerical answer

An 8-way set associative cache of size 64 KB (1 KB = 1024 bytes) is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX, and BLOCK OFFSET. The number of bits in the TAG is ______.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 19

Explanation

For a $K$-way set-associative cache, the cache is divided into sets, and an address splits as: tag | set index | block offset.

Number of sets $=\dfrac{\text{cache size}}{K\times\text{block size}}$. The set index and the block offset together address one set's worth of data:
$$\text{index bits}+\text{offset bits}=\log_2\frac{\text{cache size}}{K}=\log_2\frac{64\text{ KB}}8=\log_2 2^{13}=13.$$
(This does not depend on the block size.)

Tag bits $=32-13=\mathbf{19}$.

More Memory Interfacing and Hierarchy questions

All Memory Interfacing and Hierarchy questions →