




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





CS 333 – Fall 2006
Virtual Memory Examples^1
This example problem will help demonstrate how virtual addresses are translated into physical addresses.
Imagine a system with the following parameters:
The contents of the TLB and the first 32 entries of the page table are shown as follows. All numbers are in hexadecimal.
Acronyms and Terminology used in this handout:
(^1) Adapted from an exercise used at Carnegie Mellon University
Set 0 Set 1 Index Tag PPN Valid Tag PPN Valid 0 03 C3 1 01 71 0 1 00 28 1 01 35 1 2 02 68 1 3A F1 0 3 03 12 1 02 30 1 4 7F 05 0 01 A1 0 5 00 53 1 03 4E 1 6 1B 34 0 00 1F 1 7 03 38 1 32 09 0
Page Table VPN PPN Valid 000 71 1 001 28 1 002 93 1 003 AB 0 004 D6 0 005 53 1 006 1F 1 007 80 1 008 02 0 009 35 1 00A 41 0 00B 86 1 00C A1 1 00D D5 1 00E 8E 0 00F D4 0 010 60 0 011 57 0 012 68 1 013 30 1 014 0D 0 015 2B 0 016 9F 0 017 62 0 018 C3 1 019 04 0 01A F1 1 01B 12 1 01C 30 0 01D 4E 1 01E 57 1 01F 38 1
For the given virtual addresses, indicate:
Parameter Value Virtual Page Number 0x TLB Index 0x TLB Tag 0x TLB Hit? (Hit/Miss) Page Fault? (yes/no) Physical page number 0x
Parameter Value Virtual Page Number 0x TLB Index 0x TLB Tag 0x TLB Hit? (Hit/Miss) Page Fault? (yes/no) Physical page number 0x
a. How many valid page table entries are there?
b. How many valid page directory entries are there?
c. How much memory is in use strictly by the page directory and the page tables?
If you are curious about the contents of the Page Directory and Page Tables:
Page table physical base address: 20 most significant bits of physical page table address (forces page tables to be 4KB aligned) Avail: available for system programmers G: global page (don’t evict from TLB on task switch) PS: page size 4K (0) or 4M (1) A: accessed (set by MMU on reads and writes, cleared by software) CD: cache disabled (1) or enabled (0) WT: write-through or write-back cache policy for this page table U/S: user or supervisor mode access R/W: read-only or read-write access P: page table is present in memory (1) or not (0)
Page base address: 20 most significant bits of physical page address (forces pages to be 4 KB aligned) Avail: available for system programmers G: global page (don’t evict from TLB on task switch) D: dirty (set by MMU on writes) A: accessed (set by MMU on reads and writes) CD: cache disabled or enabled WT: write-through or write-back cache policy for this page U/S: user/supervisor R/W: read/write P: page is present in physical memory (1) or not (0)
Page table physical base addr Avail G (^) PS (^) A CD WT U/S R/W P=
Page physical base address Avail G 0 D A CD^ WT^ U/S^ R/W^ P