CS 208 s21 — Learning Block #25

Table of Contents

1 Extended Example

Below is background for the virtual memory worksheet

  • addressing:
    • 14-bit virtual addresses
    • 12-bit physical addresses
    • 64-byte pages

ataddr.png

  • page table
    • only showing first 16 entries (out of how many? one for every virtual page = \(2^{n-p} = 2^8 = 256\))
    • using 2 hex digits for PPN even though it's only 6 bits
    • other management bits not shown

atpt.png

  • translation lookaside buffer
    • 16 entries
    • 4-way associative
    • VPN split into TLB tag (TLBT) and TLB index (TLBI)

attlb.png

  • cache
    • direct-mapped with 4-byte blocks
    • total capacity of 64 bytes (16 blocks)
    • physically addressed
    • physical address split into cache tag (CT), cache index (CI) and cache offset (CO)
    • just a coincidence that PPN is the same width as the cache tag

atcache.png

1.1 Worksheet

Virtual memory worksheet (solutions below1)

Footnotes:

1
Request VPN TLBT TLBI TLB hit? page fault? PPN CT CI CO cache hit? data (byte)
0x03d4 0x0f 0x03 3 yes no 0x0d 0x0d 5 0 yes 0x36
0x038f 0x0e 0x03 2 no yes - - - - - -
0x0020 0x00 0x00 0 no no 0x28 0x28 8 0 no -
0x036b 0x0d 0x03 1 yes no 0x2d 0x2d a 3 yes 0x3b