Skip to content
GATEiit

GATE CSE 2021 Set 2 Q29: Associativity of a 2 KB cache with a 22-bit tag

Question

Consider a set-associative cache of size 2KB (1KB=2101\text{KB} = 2^{10} bytes) with cache block size of 64 bytes. Assume that the cache is byte-addressable and a 32-bit address is used for accessing the cache. If the width of the tag field is 22 bits, the associativity of the cache is ________.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 2 (official GATE 2021 final answer key)

Concept used: Address = tag + set index + block offset; number of sets = blocks / associativity.

First step: Offset is 6 bits, so the set index is 32−22−6=432 - 22 - 6 = 4 bits (16 sets); the cache has 2048/64=322048/64 = 32 blocks.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2021 Set 2 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key