C Programming — Virtual Memory
$10-30 USD
Paid on delivery
Objective:
To translate a virtual address to a physical address, involving a custom-sized fully
associative page table.
Inputs:
The total size of physical memory (in words)
The page size (words/page)
The replacement policy (LRU, FIFO)
Outputs:
The corresponding physical address for a virtual address
A message indicating a page fault (if any) in the page table
Specification:
The program translates a virtual address to a physical address based on choosing from a
menu of choices, where each choice calls the appropriate procedure, where the choices
are:
1) Set parameters
2) Map virtual address
3) Quit program
Upon entering the parameters, the page table is to be dynamically allocated based on the
total number of page frames. The page frames will be mapped to virtual pages on demand in the page frame order 0,1,2,3,…
Output:
Virtual memory to Main memory mapping:
--------------------------------------
1) Enter parameters
2) Map virtual address
3) Quit
Enter selection: 1
Enter main memory size (words): 2048
Enter page size (words/page): 1024
Enter replacement policy (0=LRU, 1=FIFO): 0
Virtual memory to Main memory mapping:
--------------------------------------
1) Enter parameters
2) Map virtual address
3) Quit
Enter selection: 2
Enter virtual memory address to access: 5000
Page fault!
-----------------
| VP | PF |
-----------------
| 4 | 0 |
-----------------
Virtual memory to Main memory mapping:
--------------------------------------
1) Enter parameters
2) Map virtual address
3) Quit
Enter selection: 2
Enter virtual memory address to access: 2048
Page fault!
-----------------
| VP | PF |
-----------------
| 4 | 0 |
-----------------
| 2 | 1 |
-----------------
Virtual memory to Main memory mapping:
--------------------------------------
1) Enter parameters
2) Map virtual address
3) Quit
Enter selection: 2
Enter virtual memory address to access: 4509
Virtual address 4509 maps to physical address 413
-----------------
| VP | PF |
-----------------
| 2 | 1 |
-----------------
| 4 | 0 |
-----------------
Virtual memory to Main memory mapping:
--------------------------------------
1) Enter parameters
2) Map virtual address
3) Quit
Enter selection: 2
Enter virtual memory address to access: 7160
Page fault!
-----------------
| VP | PF |
-----------------
| 4 | 0 |
-----------------
| 6 | 1 |
-----------------
Virtual memory to Main memory mapping:
--------------------------------------
1) Enter parameters
2) Map virtual address
3) Quit
Enter selection: 3
Project ID: #10367535
About the project
6 freelancers are bidding on average $60 for this job
Greetings, This task would be done during 2 days. Please contact me if it makes you interested my proposition. Thank you,