Linked answer questions

Statement for Linked Answer Questions 52 and 53:
A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table organization. The page table base register stores the base address of the first-level table (T1), which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2). Each entry of T2 stores the base address of a page of the third-level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16-way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.

Shared with question 52.

Question

What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the processor cache of this computer?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2013 answer key

Solution

Compare the cache index bits with the page offset bits to find the number of overlapping bits that cause the synonym problem, and compute 2 to the power of that overlap.

In a virtually indexed, physically tagged (VIPT) cache, synonyms (different virtual addresses mapping to the same physical address) can map to different cache sets if the cache set index uses bits outside the page offset.

  1. Cache geometry:

    • Cache size = 1 MB =220= 2^{20} bytes.
    • 16-way set associative: Associativity =16=24= 16 = 2^4.
    • Block size = 64 bytes =26= 2^6 bytes. Block offset requires 6 bits (bits 0 to 5).
    • Total number of blocks in cache:
      22026=214 blocks\dfrac{2^{20}}{2^6} = 2^{14}\text{ blocks}
    • Number of sets in cache:
      21424=210 sets\dfrac{2^{14}}{2^4} = 2^{10}\text{ sets}
    • Hence, the cache set index requires 10 bits.
    • The cache index bits are bits 6 through 15 of the address.
  2. Page offset:

    • From Question 52, page size is 8 KB =213= 2^{13} bytes.
    • The page offset consists of bits 0 to 12 (13 bits).
  3. Overlapping index bits:

    • Bits 6 through 12 of the cache set index fall within the page offset and are identical between virtual and physical addresses.
    • Bits 13, 14, and 15 (3 bits) fall within the virtual page number and can differ between synonyms.
    • To ensure that synonyms always map to the same cache set, the operating system must align these 3 bits (page coloring).
    • Minimum number of page colours required:
      23=8 colours2^3 = 8\text{ colours}

This corresponds to option (C).

Final answer

C

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2013 Computer Science and Information Technology (CS)
Question
53 of 65, printed as CS Q.53
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.