December
1998 QUESTION 5 Total Marks: 20 Marks |
Click here to access other
questions
SUGGESTED SOLUTIONS
|
(a) | With the aid of a diagram, explain the concept of memory hierarchy, showing how the characteristics of cost, capacity, access time and performance vary with the different sorts of memory. | [4] |
The diagram should
show CPU registers, cache, main memory, magnetic disc, magnetic tape (2 marks). It should
also show decreasing cost per bit, increasing capacity, and increasing access time (2
marks). If one or two types of memory is missing (1 mark). If two of the characteristics are shown correctly, but the third is not (1 mark).
|
||
There are several techniques of implementing virtual memory such as overlays and segmentation. Paging is by far the most effective technique. | ||
(b) | Explain what is meant by "virtual memory". | [2] |
A collection of
programs running on a machine may require more memory than the total main memory
available, but in fact only actively use a small proportion of this memory (1 mark). A
portion of the disk may be used as the main memory, and the physical memory becomes a
cache, containing those parts which are in use (1 mark).
|
||
(c) | Define the term "page table". | [2] |
A page can reside
anywhere, so a mechanism is needed to find it (1 mark). This mechanism is the page table.
A page table, which resides in memory, is indexed with the page number to provide a
transition from the virtual address to the corresponding physical page (1 mark).
|
||
(d) | With the aid of an appropriate diagram, describe how paging works. Include a definition of the term "page fault" | [6] |
The memory is divided
into a number of fixed-sized 'pages' (1 mark). Programs refer to memory locations via
their virtual addresses - i.e. addresses in the page table (1 mark). At any one time, some
pages will be stored in main memory, others will be on disc (1 mark). The page table is
used to locate the relevant data/instruction in physical memory or on disc (1 mark). If an
instruction or data word is requested which is not in physical memory, the page on which
it resides must be loaded from disc (1 mark), and the page table updated (1 mark). This is
a page fault (1 mark).
|
||
(e) | Give reasons why the page size in a virtual memory system should neither be too big or too small | [6] |
With a
small page size, there will be two problems: Since very little data is present in each
page, it will require many page faults (1 mark) and hence many I/O operations (1 mark) to
bring large amounts of data into memory. Hence it will be very inefficient (1 mark).
Secondly, the overheads (page table size, length of field for page number) will be
disproportionately high (1 mark). With a very large page size, there will be also too many page faults as too few pages will reside in main memory (1 mark). Memory will be wasted because only a small part of each large page will be in frequent use (1 mark) (this is related to the principle of locality (1 mark)) |