Quiz 4b                                                                      Name: ____________________________
November 13, 2000

Take Home.  Due in class on Monday, November 20.

    1.  Work problem 8.9 from your text.

    2.  Work problem 8.11 from your text.

    3.  Compare the three memory management schemes below in terms of memory utilization,
         facilitating the sharing of code among processes, memory allocation overhead, increase in
         run-time of the program, and fragmentation of memory.

a) For each entry in the table, fill in a 1 for the best of the three schemes, 2 for the
    medium one, and 3 for the worst one.  If there is a tie for best or worst, just use the
    same number.  (Remember, "simple paging" is with no virtual memory.)
 
 
Memory
Utilization
Sharing 
Code
Allocation
Overhead
Increase in 
Run-time
Fragmen- 
tation
Fixed Partition          
Variable Partition          
Simple Paging          
 
b) Explain your choices in the above table for the memory allocation and the
    fragmentation values related to variable partitioning and simple paging.  (In other
    words, why did you give one a higher number than the other?)
    4.  In a system that uses virtual memory, no program is likely to have all of its pages resident in
         memory at one time.  Yet it is possible, and even very likely, that a program will need access
         to every one of its pages at some point during its execution.  Therefore, every program will
         probably have to incur some penalty for running on this system.
a) What are the penalties that individual programs have to pay in such a system?

b)  Given that each individual program will take longer to run in a virtual memory
     system than it will in a non-virtual memory system, why are virtual memory
     systems useful?

c)  Give an example of general program behavior that would negate the benefits of a
     virtual memory system.

    5.  Below is the page-to-frame mapping for a user process that is currently in memory.
         Assume the page/frame size for this particular system is 16 words. (Also, assume the
         machine is word addressable, not byte-addressable.)
 
Page
Frame
0
4
1
0
2
1
3
7
         Translate the virtual addresses, 10 and 33, to what their physical addresses would be
         for this program.  Show both the decimal and binary versions of the physical address.
         (No calculators allowed for this problem.)  Show your work.
 
Virtual Address 
 
Physical Address 
Decimal
Physical Address 
Binary
10
   
33