GATE / CS ARCHIVE

GATE CSE 2018 / QUESTION 34

Set-associative cache tag width

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

GATE 2018, Q34 2 marks · MCQ
Report issue

Cache Memory

Question 34, GATE 2018: Physical addresses span 2^P bytes, words have 2^W bytes, cache capacity is 2^N bytes, blocks hold 2^M words, and associativity is K. Choose tag bits: A P−N−log₂K; B P−N+log₂K; C P−N−M−W−log₂K; D P−N−M−W+log₂K.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Method

A byte address has P bits. First convert block capacity from words to bytes, obtaining 2M+W. Cache blocks total 2N−M−W; grouping K per set divides this by K. Address bits split into tag, set index and byte-within-block offset. Increasing associativity at fixed capacity reduces index bits and therefore increases tag bits, a useful sign check on the log₂K term. The result assumes integral power-of-two field sizes.

Solution

A block contains 2M+W bytes. There are 2N−M−W/K sets, so index bits=N−M−W−log2K, and block-offset bits=M+W. Subtract both from P address bits: tag=P−N+log2K, B, under the conventional power-of-two cache parameters.

Original paper, page 14 · Answer key