Q1. Suppose we have a virtual memory of size 2 Terabytes (2048GB, or 241 bytes), where pages are 8KB (213 bytes) each, and the machine has 4GB (232 bytes) of physical memory.
a) Compute the number of page table entries needed if all the pages are being used.
b) Compute the size of the page table if each page table entry also required 4 additional bits (valid, protection, dirty, use).
Q2. For this problem, you are given a system with a virtual memory. The virtual memry hads the following configuration –
-Physical addresses are 8 bits long, but only 27 = 128 bytes of physical memory is installed, at physical addresses 0 up to 127.
-Pages are 24 = 16 bytes long. Virtual addresses are 10 bits long.
-An exception will be raised if a program accesses a virtual address whose virtual page has no mapping in the page table. Exception will also be raise if this is mapped to a physical page outside of installed physical memory.
-The main memory contents are shown in Table 1. To find the physical address of a byte, you need to read the least significant digit from the column label and the most significant digit from the row label. For example, the shaded byte in the second row is at physical address 0x12. All entries are in hexadecimal.
Table 1: Main Memory
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
|
|
0x0 |
4e |
65 |
76 |
65 |
72 |
20 |
67 |
6f |
6e |
6e |
61 |
20 |
67 |
69 |
76 |
65 |
|
0x1 |
20 |
79 |
6f |
75 |
20 |
75 |
70 |
0a |
4e |
65 |
76 |
65 |
72 |
20 |
67 |
6f |
|
0x2 |
6e |
6e |
61 |
20 |
6c |
65 |
74 |
20 |
79 |
6f |
75 |
20 |
64 |
6f |
77 |
6e |
|
0x3 |
0a |
4e |
65 |
76 |
65 |
72 |
20 |
67 |
6f |
6e |
6e |
61 |
20 |
72 |
75 |
6e |
|
0x4 |
20 |
61 |
72 |
6f |
75 |
6e |
64 |
20 |
61 |
6e |
64 |
20 |
64 |
65 |
73 |
65 |
|
0x5 |
72 |
74 |
20 |
79 |
6f |
75 |
0a |
4e |
65 |
76 |
65 |
72 |
20 |
67 |
6f |
6e |
|
0x6 |
6e |
61 |
20 |
6d |
61 |
6b |
65 |
20 |
79 |
6f |
75 |
20 |
63 |
72 |
79 |
0a |
|
0x7 |
4e |
65 |
76 |
65 |
72 |
20 |
67 |
6f |
6e |
6e |
61 |
20 |
73 |
61 |
79 |
20 |
The page table is shown in Table 2. The virtual page number in the
left column is mapped to the
physical page number in the second column. Virtual page numbers are
listed in binary.
Table 2: Page Table
| Virtual page | Physical page |
| 0 | 0x2 |
| 1 | 0x4 |
| 10 | 0x1 |
| 11 | 0x5 |
| 100 | 0x4 |
| 101 | 0x7 |
| 110 | 0x9 |
a) List the four bytes in the word beginning at physical address
0x34.
b) How many virtual addresses refer to the first byte of the shaded
word in row 0x2 ? List them
ALL.
c) How many virtual addresses refer to the first byte of the shaded
word in row 0x4 ? List them
ALL.
d) List all virtual addresses that refer to the first byte of the shaded word in row 0x6.
e) If the program loads a word from virtual address 0x5C
(01011100), write down what data is
returned?
f) What is the result if the program loads a word from virtual
address 0x64 (01100100)?

Q1. Suppose we have a virtual memory of size 2 Terabytes (2048GB, or 241 bytes), where...
Suppose we have 2^20 bytes of virtual memory and 216 bytes of physical main memory. Suppose the page size is 2^8 bytes. a) How many pages are there in virtual memory? b) How many page frames are there in main memory? c) How many entries are in the page table for a process that uses all of virtual memory?
Exercise l: Suppose that we have a virtual memory space of 28 bytes for a given process and physical memory of 4 page frames. There is no cache. Suppose that pages are 32 bytes in length. 1) How many bits the virtual address contain? How many bits the physical address contain? bs Suppose now that some pages from the process have been brought into main memory as shown in the following figure: Virtual memory Physical memory Page table Frame #...
Suppose you have a byte-addressable virtual address memory system with 8 virtual pages of 64 bytes each, and 4-page frames. Assuming the following page table, answer the questions below: Page #Frame #Valid Bit0111312-03014215-06-07-0a) How many bits are in a virtual address? b) How many bits are in a physical address? c) What physical address corresponds to the following virtual addresses (if the address causes a page fault, simply indicate this is the case)? 1) Ox00 2) 0x44 3) OxC2 4) 0x80
Suppose we have 212 bytes of virtual memory and 27 bytes of physical main memory. Suppose the page size is 24 bytes. a) How many pages are there in virtual memory? b) How many page frames are there in main memory? c) How many entries are in the page table for a process that uses all of virtual memory?
1) The following page table illustrates a system with 12-bit virtual and physical addresses and 256-byte pages. Free page frames are to be allocated in the order9 F, D. A dash for a page frame indicates that the page is not in memory. (4 points) Page Page-Frame 0x4 OxB 0 2 4 0x2 0x0 0xC 7 Convert the following virtual addresses to their equivalent physical addresses irn hexadecimal. All numbers are given in hexadecimal. In the case of a page...
Question 2 Suppose you have a byte-addressable virtual address memory with 8 virtual pages of 64 bytes each and 4 page frames. Assuming the following page table, Page = Frame Valid Bit 0 0 1 2 3 4 5 What physical address corresponds to the virtual address 0X44 a. OXC1 b.OXC2 COXC4 d. OXCO OXC3
3. Virtual Memory (20 points) An ISA supports an 8 bit, byte-addressable virtual address space. The corresponding physical memory has only 256 bytes. Each page contains 32 bytes. A simple, one-level translation scheme is used and the page table resides in physical memory. The initial contents of the frames of physical memory are shown below. VALUE address size 8 bit byte addressable each byte of addressing type memory has its own address 32 B page size physical memory size 256...
A certain computer provides its users with a virtual memory space of 2^32 bytes. The computer has 2^18 bytes of physical memory. The virtual memory is implemented by paging, and the page size is 4,096 bytes. A user process generates the virtual address 11123456 hexadecimal. a. How many entries are there in the page table? b. Explain how the system establishes the corresponding physical location.
page addressing (a) The following are virtual 16 Considered bit-addresses, with the upper 8th Bit the number of the page and the lower one 8th Bit represent the offset. The physical memory included in this example 256 Page frames ( frames ) to each 256 Bytes per page, ie physical addresses from 0x0000 to 0xFFFF, where frame 0 at 0x0000 starts. Given the following page table for a process that 10 Pages (page numbers 0 - 9), some of which...
The RISC-V 32-bit architecture supports virtual memory with 32-bit virtual addresses mapping to 32-bit physical addresses. The page size is 4Kbytes, and page table entries (PTEs) are 4 bytes each. Translation is performed using a 2-level page table structure. Bits 31:22 of a virtual address index the first-level page table. If the selected first-level PTE is valid, it points to a second-level page table. Bits 21:12 of the virtual address then index that second-level page table. If the selected second-level...