Question: Write a C/C++ program to simulate the Paging technique of memory management. Following steps should be implemented in the program: Ask the user to enter

Write a C/C++ program to simulate the Paging technique of memory management.

Following steps should be implemented in the program:

  1. Ask the user to enter memory size.
  2. Ask the user to enter page size.
  3. Display number of pages in memory according to the acquired data
  4. Ask the user to input the number of processes and pages required for each process.
  5. Enter the page table of each process.
  6. If enough memory is available, assign memory to each process otherwise display the message Memory is Full
  7. Compute and display the physical address of a memory address by asking the user to enter process number, page number, and offset.
  8. If the user inputs correct data, compute and display the corresponding physical address, otherwise display an error message,

The output of the program should be as follows:

Write a C/C++ program to simulate the Paging technique of memory management.

saleha@ubuntu:-/Desktops gcc paging.c saleha@ubuntu:-/Desktop$ ./a.out Enter the memory size -- 1000 Enter the page size 100 10 The no. of pages available in memory are Enter number of processes -- 3 Enter no. of pages required for P[1]-- 4 Enter pagetable for P[1] 8 6 95 Enter no. of pages required for P[2] -- 5 Enter pagetable for P[2] --- 1 4 5 7 3 Enter no. of pages required for P[3]-- 5 Memory is Full Enter Logical Address to find Physical Address Enter process no. and pagenumber and offset -- 2 3 60 The Physical Address is 760saleha@ubuntu:-/Desktops |

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!