Laboratory Exercises For Computer Science 211

Main Memory Structure

Goals: This laboratory exercise provides experience with elements of paging and segmentation.

Steps for this Lab: This lab encourages discussion of algorithms and issues related to paging and segmentation. Thus, for this lab, each person should work in a group of two (preferred) or three students; within a group, each person should take responsibility for leading discussion for some of the problems.

  1. Review Section 6.1 in the text.

  2. Solve problems 3, 6, and 8 in Chapter 6 (pages 477-478) in the text.

  3. In class, we have discussed segmentation briefly, including a consideration of first fit, next fit, and best fit algorithms. Now, assume a total 64K memory allocation with a minimum of 1K allocated at one time, and consider the following sequence of events:
    Allocate:  A 10K
    Allocate:  B 8K
    Allocate:  C 15K
    Allocate:  D 12K
    Deallocate:  A
    Allocate:  E 11K
    Deallocate:  C
    Allocate:  F 8K
    Allocate:  G 7K
    Deallocate:  D
    
    1. Show the configuration that would result from this sequence of requests using a first fit algorithm.
    2. Show the configuration resulting from a next fit algorithm.
    3. Show the configuration from a best fit algorithm.

    For each configuration, show complete information for each free list (including the first pointer and all size and next fields).

Only one write-up of each problem should be turned in for each group, and the writing of solutions should be shared by group members. Each member of a group must write up at least one problem, and each solution should be reviewed by all members of the group. After solutions are written (and revised as necessary) to the satisfaction of all group members, the solutions should be collected together and turned in as a single packet from the group.


This document is available on the World Wide Web as

     http://www.math.grin.edu/~walker/courses/211.fa01/labs/lab.memory.html

created November 24, 1997
last revised December 3, 2001
Valid HTML 3.2!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.