Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 2.83 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 1. a) 64 pages x 1024 words = 2^16 x 2^10 = 2^16
  2.         There are 16 bits in the logical address.
  3.     b) 32 frames x 1024 words = 2^5 x 2^10 = 2^15
  4.         There are 15 bits in the physical address.
  5.  
  6. 2.  a) The issue with external fragmentation is that as memory is allocated contiguously, and processes  are loaded and then removed, holes are created in the memory space, causing fragmentation. Pure   segmentation has this issue as well, however pure paging avoids the fragmentation.
  7.      b) While pure paging does not lead to external fragmentation, it does cause internal fragmentation when the allocated space is not completely used.
  8.      c) Code sharing is not possible with contiguous memory allocation because processes are located in different memory spaces and therefore no sharing of memory.
  9.  
  10. 3.   a)         page = 2375/1024 = 2
  11.         offset = 2375 % 1024 = 327              2.327
  12.       b)        page =  19366/1024 = 18
  13.                 offset = 19366 % 1024 = 934             18.934
  14.       c)        page = 30000/1024 = 29
  15.                 offset = 30000 % 1024 = 304             29.304
  16.       d)        page = 256/1024 = 0    
  17.         offset = 256 % 1024 = 256               .256
  18.       e)        page = 16385/1024 = 16
  19.         offset = 16385 % 1024 = 1               16.1
  20.  
  21. 4.  a)  4KB page size = 2^12
  22.         (2^32 logical address) / (2^12 page size) = 2^20 entries
  23.      b) 4KB page size = 2^12
  24.         32-12=20 bits left for the page number
  25.         2^(20/2) = 2^10 entries
  26.      c) Level has 22-bit logical address
  27.         4KB page size = 2^12
  28.         (2^22 logical address) / (2^12 page size) = 2^10 entries per page
  29.        
  30. 5.  a) 100 nanoseconds to access the page table plus 100 nanoseconds to access the word from memory.
  31.         It will take 200 ns for the paged memory reference.
  32.      b) 85% of the time it will take 100 ns, and the 200 ns for 15% of the time.
  33.         So… (.85 * 100) + (.15 *200) = 115 ns effective memory reference time
  34.  
  35. 6. Both of these issues are caused by a particular program referencing its own code without knowing the segment or page number for the address. This problem is solved by associating four registers with the processes. All references must be indirect by means of a register mapped to the segment or page number. Changing these registers allows the same code to execute for separate processes without a same page or segment.
  36. 7.      a) Yes, the thread changes from the Running state to the Blocked state when a page fault occurs.
  37.         b) If the page is already in main memory, the TLB is updated for the new page entry. If the page is not in main memory, a page fault is generated.  The process is then changed to the Blocked state.
  38.         c) No, because no I/O operation is needed because this indicates that the page needed is already in main memory.
  39.  
  40. 8. Every time memory is accessed, the page table must be checked as to whether or not the page exists and whether or not the program has read/write privileges for accessing that page. It is required that these checks be performed within the hardware.