GateAI
Cache Memory and Hierarchy

GATE CSE 2013 · Q20

MCQ1 markMedium

Time

In a kk-way set associative cache, the cache is divided into vv sets, each of which consists of kk lines. The lines of a set are placed in sequence one after another. The lines in set ss are sequenced before the lines in set (s+1)(s+1). The main memory blocks are numbered 00 onwards. The main memory block numbered jj must be mapped to any one of the cache lines from

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) (j mod v) * k to (j mod v) * k + (k-1)

Cache Memory and Hierarchy

In a set-associative cache with vv sets, a main memory block jj maps to the set given by:

s=j mod vs = j \bmod v

Each set contains kk cache lines arranged consecutively. Since the lines in set ss come after all lines of sets 0,1,…,s−10, 1, \dots, s-1, the starting cache line index for set ss is:

Start line=s×k=(j mod v)∗k\text{Start line} = s \times k = (j \bmod v) * k

Since there are kk lines in this set, the range of valid line indices for block jj is:

(j mod v)∗kto(j mod v)∗k+(k−1)(j \bmod v) * k \quad \text{to} \quad (j \bmod v) * k + (k - 1)

Hence, the correct option is (A).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Cache Memory and Hierarchy previous year question is Q20 of the GATE CSE 2013 paper. Find more GATE CSE PYQs on Cache Memory and Hierarchy in Computer Organization and Architecture, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Cache Memory and Hierarchy PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Cache Memory and Hierarchy in GATE CSE

Cache Memory and Hierarchy has 47 GATE CSE PYQs across 23 papers from 2011 to 2026. 4 of them are 1-mark MCQs like this one, and GATE CSE 2013 has 3.

How GATE tests Cache Memory and Hierarchy

More from GATE CSE 2013

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2013 · Q20 · MCQ

In a k-way set associative cache, the cache is divided into v sets, each of which consists of k lines. The lines of a set are placed in sequence one after another. The lines in set s are sequenced before the lines in set (s+1). The main memory blocks are numbered 0 onwards. The main memory block numbered j must be mapped to any one of the cache lines from

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.