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

  What is the minimum number of attendants

A nursing home employs attendants who are needed around the clock. Each attendant is paid the same, regardless of when his or her shift begins. Each shift is 8 consecutive hours.

  Determine the values for m and l for the b+ tree

A B+-tree is to be stored on disk whose block size is 2048 bytes. The data records to be stored are 50 bytes, and their key is 4 bytes. Determine the values for M and L for the B+-tree. Assume pointers are 4 bytes each.

  Estimate cost of multi phase multiway merge sort

Find out number of phases needed, and estimate cost of Multi Phase Multiway Merge Sort. Write all BCNF violations. Decompose relations, as essential, into collections of relations whic hare in BCNF.

  Encryption feistel cipher and decryption algorithm

If this is psudocode for encryption feistel cipher determine decryption algorithm?Output: ciphertext = (left[16], right[16]) Explain pseudo-code of corresponding decryption algorithm for this cipher.

  Describe a fair coin algorithm to returns either 0 or 1

Describe a FAIRCOIN algorithm that returns either 0 or 1 with equal probability, using ONEINTHREE as your only source of randomness.

  How pseudocodes can be optimized to improve efficiency

Create an Alice World with four helicopters and a list containing the helicopters. Program the world to make the helicopters each lift off from the ground one at a time and then all turn and fly away together.

  Explain compression algorithms are often used in forensics

"Compression algorithms are often used in forensics. Suppose you are involved in a case and have been asked by the lawyer to explain, in general terms.

  Edge connectivity of undirected graph-running maximum-flow

Illustrate how edge connectivity of undirected graph G = (V, E) can be determined by running maximum-flow algorithm on at most |V| flow networks, each having O(V) vertices and O(E) edges.

  Design a representation of display screen

Create a form that lists possible potatoes and toppings in a manner that is easy for counter servers and kitchen crew to scan, and can also be used as input for the inventory reorder system.

  Question about unix commands

Assume you have a document called records.txt having the list of employee id and workers names. Every line contains a single employee id immediately followed by the employee name in the format Last name, First name.

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Illustrate how b-tree will expand

Illustrate how tree will expand (after inserting each Part#), and what the final tree would like. (b) Repeat item (a), but use a B-tree of order p = 4 instead of a B+-tree.

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