Multiple choice

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.

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?

  1. 2

  2. 4

  3. 8

  4. 16

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Page colors ensure virtually indexed cache doesn't map synonyms to different sets. Cache has 16 ways, so each set can hold 16 lines. Page size = cache block size = 64 bytes = 2^6 bytes. Number of cache sets = cache size / (ways × block size) = 2^20 / (16 × 2^6) = 2^20 / 2^10 = 2^10 = 1024 sets. Number of colors needed = sets / block_alignment = 1024 / 512 = 2. This ensures virtual pages differing only in high bits map to same set.