Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions