Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Objectives To simulate Least Recently Used (LRU) memory page replacement algorithm using C/C++ 2. Procedures We can think that the virtual memory is the

1. Objectives To simulate Least Recently Used (LRU) memory page replacement algorithm using C/C++ 2. Procedures We can think that the virtual memory is the hard disk and the main memory is the RAM in PC. Assume that the virtual memory has 5 to 9 pages and the main memory has 3 to 5 frames. The frame size is the same as page size. The size can be any reasonable kilobytes, say, 16 Kbytes or 64 Kbytes. Modify your last week's lab and simulate LRU page replacement algorithm. a. In this program, you will: Prompt the user to enter the number of pages (5 to 9) Prompt the user to enter the number of frames (3 to 5) Prompt the user to enter the page reference string. Spaces are used to separate the page numbers referenced by the processes. Implement the LRU page replacement algorithm. Your program should cover a few situations: o Pure page demanding (at least one frame is left in the main memory, occurs initially) o The page requested is already in one of the frames in the main memory (requested before and not replaced yet) o The page is not in the main memory and the LRU page among all will be replaced Display all frame replacements sequence Calculate and display the number of page faults Please i need the code so i can run it thanks.

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago