Implement a virtual memory simulator based on demand paging

Assignment Help Data Structure & Algorithms
Reference no: EM13330557

Design and implement a virtual memory simulator based on Demand Paging.

It will be a text based application (NOT a GUI based one).

The programming language can be C or Java.

The following algorithms will be implemented: FIFO, OPT and LRU.

We will simulate the execution of each of these algorithms on a hypothetical computer having only four physical frames (numbered from 0 to 3), assuming that the single process that is running has a virtual memory of eight frames (numbered from 0 to 7).
The algorithms will be simulated based on a reference string (a sequence of pages that are to be accessed) that will be either read from the keyboard or randomly generated.

The program will be menu-based and the menu will have the following options:

0 - Exit

Will exit the program

1 - Read reference string

A reference string will be read from the keyboard and stored in a buffer. Each value of the reference string will be verified and validated (or rejected).

The user will be first asked to enter the length of the reference string, and then the string itself will be entered.

2 - Generate reference string

A reference string will be randomly generated; the length of the reference string will be given by the user interactively. The string will be stored in a buffer.

Using options 1 and 2 more than once will result in overwriting the old reference string.

3 - Display current reference string

Will display the stored reference string; if there is no reference string stored yet, an error message will be displayed.

4 - Simulate FIFO

Will simulate the step by step execution of the FIFO algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed.

The user will press a key after each step of the simulation to continue the simulation.

5 - Simulate OPT

Will simulate the step by step execution of the OPT algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed.

The user will press a key after each step of the simulation to continue the simulation.

6 - Simulate LRU

Will simulate the step by step execution of the LRU algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed.

The user will press a key after each step of the simulation to continue the simulation.

Your final project will be graded based on:

• functionality
• proper style: comments, indentation, use of white space, variable names
• adherence to requirements + test plan
• user-friendly application

Test your program using the examples from the online course Module 3 and the Homework 4. Create a test plan document showing the results of this testing (testplan.doc).

Please do not forget to do a thorough error checking for this important project.

It is also important to comment your code in order to make it more easily readable and understandable.

Each file must have a block comment in the beginning.

Each class must be preceded by a comment describing the main goal and function of that class.

Each method and each attribute must be explained.

Important actions in the code must be commented (e.g: error checking).

Reference no: EM13330557

Questions Cloud

How to compute the volume of so2 at standard conditions : How do i calculate the volume of SO2 at standard conditions (25 degrees C and 1.00 atm pressure) produced from the heat treatment of 10.00 metric tons of NiS, assuming the reaction goes to completion with 100% conversion of S to SO2
Illustrate the value of information in today economy : Explain the increasing dependence on knowledge workers in business and provide at least two examples that illustrate the value of information in today's economy.
What is an upper bound for the one-year futures price of oil : Estimate the futures price of the index for three-month and six-month contracts. All interest rates and dividend yields are continuously compounded.
Calculate the size of the force on the car due to the truck : A car of mass 9.50×102kg and a truck of mass 3.00×103kg run into one another due to ice on the road. Calculate the size of the force on the car due to the truck at that time
Implement a virtual memory simulator based on demand paging : Will simulate the step by step execution of the OPT algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed.
Calculate the magnitude of the boys acceleration : A 41.7kg boy and a 56.4kg girl are on the surface of a frozen lake, 14.0m apart. Calculate the magnitude of the boy's acceleration
Which model will be most appropriate for staffing : Every company finds it challenging to recruit and select top executives for an international location. The nationals of the host country will be aware of the local laws and customs and may accept a lower wage as well, but may not be familiar w..
Explain the equation discovered by balmer to solve n2 : Rearrange the equation discovered by Balmer to solve for n2 (get n2 by itself): 1/? = R(1/2^2 - 1/n^2) where: ? = is the wavelength of the photon (E=hc/?) R = Rydberg's constant (1.0974x10^7 m^-1) n1 and n2 are integers where n2 > n1.
Explain what is the partial pressure of o2 : What is the partial pressure of O2 (in millimeters of Hg) in a hyperbaric chamber pressurized to 5 atm with air that is 18% in

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Adopting agile development methodologies

Relative advantages are the degree to which a new technology is perceived to be superior to current technology. An company is more likely to adopt new technology when it perceives greater relative

  Possible inputs to a given comparison-based

One of the n! possible inputs to a given comparison-based sorting algorithm, what is the absolute maximum number of inputs that could be sorted with just n comparisons?

  Data structures class

data structures class this project will give you an introduction. There are two important data structures that you will learn and use. The first is a stack, it is a LIFO (Last In First Out) structure. You can think of it like a a stack of plates in y..

  Inventory tracking database

Construct a relational database of your choice. The DB should contain no more than six tables. Define three business requirements that this database will provide.

  Processor sharing to worse performance than fcfs

Create a second experiment answering the question "Is it possible for processor sharing to have worse performance than FCFS? "

  Create algorithm which generates access control matrix

Create an algorithm which generates the access control matrix A for any given history matrix H of the Chinese Wall model.

  The time delay of a long-distance

The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication links on the telephone network between the caller and callee

  Analyze algorithm to determine length of longest substring

Explain and analyze the algorithm to determine the length of longest substring that appears both forward and backward in an input string T[1 . n].

  Write a c++ program that creates and populate a tree

Write a C++ program that creates and populate a tree for an arithmetic expression. Then it should perform an in-order and a post-order traversal on the tree. The input of the program will be a text file with the arithmetic expressions in RPN.

  Questionm about distributed database

Explain what a distributed database is and how replication works with respect to managing the information in these databases.

  Diagram of a telephone network

Consider a diagram of a telephone network, which is a graph G whose vertices represent switching centers, and whose edges represent communication lines joining pairs of centers. Edges are marked by their bandwidth, and the bandwidth of a path is the ..

  Why there are no forward nontree edges

Explain why there are no forward nontree edges with respect to a BFS (breadth-first search) tree constructed for a direct graph.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd