Question: This question consists of writing a program that translates logical to physical addresses for a virtual address space of size 23 bytes. Your program will

 This question consists of writing a program that translates logical to

This question consists of writing a program that translates logical to physical addresses for a virtual address space of size 23 bytes. Your program will read from stdin a list of logical addresses, translate each logical address to a physical address and then print the physical address that would be accessed in memory. However, your simulation can only n pages loaded in memory at any given time! The goal is to simulate the steps involved in translating logical to physical addresses. Design your simulation with the following parameters: A page is 212 - 4 kilobytes. (Note, this means a frame is also 22 in size) Therefore, the page table has 220 entries. You can use a simple array to implement this table. Your process has been allocated n frames. n is a parameter to your program on the command line For the address translation you are to use the simple single level of page table mapping (page table is 20 bits, page offset is 12 bits) Your program should print for each logical address read: logical address -> physical address It should also keep track of the number of page faults that occur and print the statistic at the end. Notes: Running your program with a sample file can be done as: /a.out 10 physical address It should also keep track of the number of page faults that occur and print the statistic at the end. Notes: Running your program with a sample file can be done as: /a.out 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!