Assume that the OS is using a memory paging method, memory pages are 512 words l
ID: 3559898 • Letter: A
Question
Assume that the OS is using a memory paging method, memory pages are 512 words long, instructions are 4-word long, and each address in memory accesses only one word.
Calculate a starting physical memory address for each of the following instructions. If the address can not be caculated using the page table and the given info, say why not
Instructions #52
Instructions #369
Instructions #512
Instructions #612
Instructions #640
Page Number Frame Number
0 7
1 0
2 2
3 4
4 1
Explanation / Answer
each instruction have 4 words.
and memory pages are 512 words long
1)- instruction no. 52
so word number = 52*4 = 208
it means this is in first page
whose page number is 0, frame number = 7
offset = 208
so physical memory address = 7 *512 +208 = 3792
2)- Instructions #369
words = 369 *4= 1476
page number = 1476/512 = 2,
offset = 1476 % 512= 452
frame no = 2
so physical address = 2*512 + 452 = 1476
3)- Instructions #512
words = 512 * 4 = 2048
page number 2048/512 = 4, offset =0
frame number = 1
so physical address = 1*512 + 0 = 512
4)- Instructions #612
words = 612*4 = 2448
page number = 2448/512 = 4
frame = 1, offset = 400
physical address = 512 *1 + 400 = 912
5)- Instructions #640
words = 640 *4 = 2560
page number = 2560 /512 = 5
since there is no entry in page table corressponding to page number 5 ,
so its physical address cannot be found