UNIVERSITY OF WISCONSIN-MADISON
Computer Sciences Department
CS 537
Spring 2000
A. Arpaci-Dusseau
Quiz #7
March 28

Probem 1: Segmentation

Consider a virtual memory architecture with the following parameters:

Show how a virtual address gets mapped into a real address. Be sure to show

  1. how the various fields of each address are interpreted,
  2. the size of each field (in bits),
  3. the maximum number of entries the table could hold, and
  4. where checks are made for invalid virtual addresses.

Draw and label a diagram to answer this question.



Segment Table

The Segment Table has 256 entries, with each entry being 54 bits.

Problem 2: Multi-Level Paging

Consider a virtual memory architecture with the following parameters:

Show how a virtual address gets mapped into a real address. Be sure to show

  1. how the various fields of each address are interpreted,
  2. the size of each field (in bits),
  3. the maximum number of entries each table could hold, and
  4. the maximum size possible for each table (in bytes).

Draw and label a diagram to answer this question.



Two level page table

The first-level page table has 1M entries times 48 bits (6 bytes, 43 bits rounded up to 48, a multiple of 8 bits), so has a maximum size of 6 MB.

Each second-level page table has 8K entries (not 32K entries!). The page size is 32KB and the second-level PTE has a PPN of 30 bits (rounded up to 32 bits) or 4 bytes. A 32KB page can hold 8K 4-byte entries. 4 bytes times 8K is 32KB. The extra bits in any of these entries might be used for valid or read/write bits.

Problem 3: Paging and TLB's

Consider a virtual memory architecture with the following parameters (note that these are the same parameters from Quiz #8):

Add a TLB to the memory mapping architecture that is described above. This cache should be 2-way set associative and have 512 rows.

  1. On the next page draw a diagram of the TLB, showing the size of each field in the TLB. Indicate how bits of the VA are used for input to the TLB, and describe the outputs from the TLB.

    Include read/write protection bits for each page in your TLB.

  2. If your PTE's contain R/W protection bits, why do they also need to be included in the TLB?

    If an address hits in the TLB, it will bypass looking in the page table. If the R/W bits are only in the page table, we wouldn't be able to check the permissions on pages whose addresses were in the TLB.



TLB