GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 9(a)

Number of cache sets

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2001 paper

GATE 2001, Q9(a) Descriptive
Report issue

Cache Memory

Question 9(a), GATE 2001: 32-bit byte addresses; cache data capacity 256 KB=2^18 bytes; 4-way set associative; 16-byte blocks.

Task: Find the number of cache sets.
Question 9(a), GATE 2001: 32-bit byte addresses; cache data capacity 256 KB=2^18 bytes; 4-way set associative; 16-byte blocks.

Task: Find the number of cache sets.
Tap to enlarge
Shared context

32-bit byte addresses; cache data capacity 256 KB=2^18 bytes; 4-way set associative; 16-byte blocks.

Answer & solution

Answer: 4096 sets. (no official key was published)

Step through it (7 steps)

1. First count cache blocks: 218 bytes ÷24 bytes/block =214 blocks, or 16,384 blocks.

2. Four-way associativity means four blocks in each set, not four sets. Divide by four to obtain 214/2²=212=4096 sets.

3. Equivalently, one set holds 4×16=64 data bytes, and 262,144/64=4096. This cross-check uses the complete data capacity.

4. Consequently the set index requires 12 bits, a fact used when partitioning the address in later parts.

Original paper, page 8