COS 126: Fall 1996
Exercise Set 9
Answers

These exercises are intended help review the material on virtual memory and file systems. Do not turn in solutions.

  1. Which of the following must be true about virtual memory:
    a. A virtual address must have at least as many bits as a physical address.
    b. A physical address must have at least as many bits as a virtual address.
    c. Both of the above.
    d. None of the above.
  2. Suppose that a disk has 224 blocks, 212 bytes per block. All files are defined by a block with 26 bytes of descriptive information, followed by a list of data block numbers. How big a file can be accommodated?
  3. The same disk is configured with 216 blocks, 220 bytes per block. How big a file can be accommodated?

Answers

As always, try to solve the problems before looking at the suggested solutions.

  1. d.
  2. Data block numbers must be 3 bytes to accommodate 24-bit addresses. Thus, (212 - 26) / 3 = 1344 block numbers can fit in the descriptive information block, so the file size is 1344×212 = 5505024.
  3. ((220 - 26) / 2)×220 = 549722259456.

Copyright © 1996 David R. Hanson / drh@cs.princeton.edu
$Revision: 1.2 $ $Date: 1996/11/26 18:58:38 $