You are on page 1of 2

Activity #16 Solution

1. (40 points) Consider a virtual memory system with the following properties:

30-bit virtual byte address


64 KB pages
20-bit physical byte address

Show your calculations for each part.


1.a. (10 points) What is the size of a frame (i.e., a physical page) on this machine?
Frames are always the same size as pages, so 64 KB = 216 bytes.
1.b. (10 points) How many bytes does the virtual address space contain?
230 bytes.
1.c. (10 points) How many bytes of DRAM are installed on this machine? How many frames?
220 bytes of DRAM.
Number of physical frames = 220 / 216 = 24 = 16.
1.d. (10 points) How many pages does this machine have in its virtual address space?
230 / 216 = 214 = 16K pages.
Grading: for each part a-d: 2 pts for trying, +8 pts for each correct

ECSE-2660 Computer Architecture, Networks, & Operating Systems, Spring 2014

Page 1 of 2

2. (20 points) Memory Organization. In a virtual memory system, some memory word A is to
be fetched into CPU. The page table fits into the main memory and single-level paging is
applied. Determine the number of necessary accesses to the physical memory for the
following cases. Assume TLB is checked first, and hence cache is indexed by physical
addresses. Explain your reasoning.

TLB has the physical address of A, and cache has the content of A.
0. Non need to access main memory

TLB has the physical address of A, but cache does not have the content of A.
Just 1 for fetching the content of A from the physical memory.

TLB does not have physical address of A, but cache and main memory have the content
of A.
2. Since we assume that the design will not check the cache on a TLB miss, then the
answer is 2; 1 for fetching the physical address of A from page table in main memory
and another for reading the page from physical memory.

TLB has the physical address of A, but neither cache nor the physical memory has the
content of A. Assume that none of the frames in physical memory are dirty.
2 accesses to main memory needed: No need to access main memory in the address
translation phase. However, since content is not in cache or main memory, ie. there is a
page fault, it results in 2 accesses to main memory (one for fetching the page from disk
to a frame in physical memory (write), and one for fetching content of A from physical
memory to cache (read), so 2 accesses).
Grading: 5 pts for each of the three cases. For each case, 2pts for trying, 3pts for
correct answers without proper explanation, 5pts for correct and properly explained
answers.

ECSE-2660 Computer Architecture, Networks, & Operating Systems, Spring 2014

Page 2 of 2

You might also like