Write a c program compute the number of page faults

Assignment Help Computer Engineering
Reference no: EM132196979

Write a C program (well-structured modular) to compute the number of page faults for the FIFO page replacement scheme, given a reference string.

The program can be structured as follows: the program will first interactively prompt and read the length of the reference string and then reference string itself.

Then it will prompt and read the range for the number of page frames. For each value in the range then simulate the execution of the page replacement algorithm on the reference string, compute the number of page faults and print it out.

Assume that the length of the reference string is at most 20 so that the reference string can be stored in an array of int type.

Assume that the number of frames available will be at most 20, so you can implement the data structure (queue) needed for the simulation of the algorithm using arrays rather than using pointers, if you prefer it that way. Also assume that all frames are initially empty, so your first unique pages will all cost one fault each.

Here is a sample run of the program:

Welcome to FIFO Page Replacement Simulation Program!!

Enter the length of the reference string: 12

Enter the reference string: 1 2 3 4 1 2 5 1 2 3 4 5

Enter the range for number of frames: 1 6

Page fault for 1 frame(s): 12

Page fault for 2 frame(s): 12

Page fault for 3 frame(s): 9

Page fault for 4 frame(s): 10

Page fault for 5 frame(s): 5

Page fault for 6 frame(s): 5

Program terminated

Reference no: EM132196979

Questions Cloud

Explain advantages and disadvantages of globalization : Globalization brings with it both advantages and disadvantages, economic and otherwise. List some of each, according to your own view of globalization.
Create a dunbar object set the force of the object : Write the class that will carry out the following steps. This code would be part of a program, but you only have to write out the steps requested here.
Make the three data members private : Write a class to contain the following information about towns: the name (a sequence of characters); the population (an integer);
Draw a graph of typical indifference curves : Draw a graph of typical indifference curves, budget constraints, the optimal choice of a typical subscriber under the current fixed-rate policy.
Write a c program compute the number of page faults : Write a C program compute the number of page faults for the FIFO page replacement scheme, given a reference string.
Explain graphically the speculative attacks : Explain graphically the speculative attacks that occurred against the British pound in 1992, the Mexican peso in 1994, the Thai baht in 1997.
Fill all array elements with a zero except those diagonal : Declare a two dimensional array with 10 rows and 10 columns of whole numbers.
Does income effect incentivize person to take less leisure : Change the wage to $8. From a starting point of 500 hours of work at $10 an hour, does the income effect incentivize the person to take less leisure.
Draw a dashed curve showing the equilibirum price trajectory : Draw a dashed curve showing the equilibirum price trajectory(price as a function of time); list the conditions used to obtain this graph.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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