ECS154A Homework #4

LAB Assignment:

WRITTEN Assignment:

  1. A virtual memory system for a byte-addressable processor with 4-byte words has a page size of 512 words, eight virtual pages, and four physical page frames. The page table is as follows:
    Virtual page Number	Page Frame Number
    
            0                        1
            1                        3
            2                        0
            3                        -
            4                        -
            5                        2
            6                        0
            7                        -
    
  2. Give reasons why the page size in a virtual memory system should be neither too large or too small.

  3.  
  4. A computer has a cache, main memory, and a disk. If a reference to the cache is a hit, it takes 9 ns to retrieve the data. If a reference misses in the cache, it takes 72 ns to fetch the item from memory and put it in the cache, at which point the request is reissued to the cache. If the required item is not in main memory, it takes 11 ms to fetch the word from the disk, followed by 75 ns to copy the word to the cache, and then the reference is reissued to the cache. The cache hit ratio is .91 and the main memory hit ratio is .73. What is the average time in nanoseconds to access a data item on this system?

  5.  
  6. Assume a task is divided into 4 equal-sized segments, and that the system builds an 8-entry page descriptor table for each segment. Thus, the system has a combination of segmentation and paging. Assume also that the page size is 4K bytes

  7. Consider a paged logical address space (composed of 32 pages of 2K bytes each) mapped into a 1-MByte physical memory space.

  8.  
  9. The following tables contain information about a segmented, paged virtual memory system and certain select memory locations. Total physical memory size is 2K bytes. All numbers in this table are in Hex unless otherwise noted. The processor is byte-addressable, and uses little-endian storage.
  10. ------------------------------------------------------------------------------
                    Segment Table
    
    Entry Number    Presence bit    Page Table
         0                0             0
         1                1             1
    ------------------------------------------------------------------------------
    
                            Page Table 0
    
    Entry Number    Presence bit    Disk Address    Physical Page Number
         0                0          0x443BH096             0x0
         1                1          0x08D22108             0x3
         2                1          0xF0871A09             0x1
         3                0          0x7BA54C21             0x2
    
    ------------------------------------------------------------------------------
    
                            Page Table 1
    
    Entry Number    Presence bit    Disk Address    Physical Page Number
         0                1          0x88B04136             0x2
         1                0          0xEF444219             0x0
         2                1          0x00222957             0x3
         3                1          0x28756554             0x1
    
    ------------------------------------------------------------------------------
    
    Memory
    
    Address Contents
    0x02A4  0x7230
    0x03A4  0x86a9
    0x04A4  0x9723
    0x05A4  0x3423
    0x06A4  0x8876
    0x0FA4  0x2373
    0x11A4  0x1346
    0x17A4  0x6792
    0x1EA4  0x5292
    0x37A4  0x7974
    0x3BA4  0x3205
    0x67A4  0x6623