Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: Virtual Memory

Write a program to simulate the Least-Recently-Used (LRU) Page Replacement Algorithm that appears on page 366 of the textbook. In particular, the simulator should accept the following input from standard input (stdin):

Number of Virtual Pages
Number of Page Frames Available (not used by page table)
Number of References
Page Referenced Read or Write (0 or 1, respectively) duration
Page Referenced Read or Write (0 or 1, respectively) duration
            :            :

For example:

5
3
2
0 0 2
1 1 1
3 0 1

is valid input. There are 5 virtual pages (numbered 0, 1, ... 4), 3 page frames (numbered 0, 1, 2) in memory, 3 references listed: page 0 is read from for 2 clock ticks, page 1 is written to for 1 clock tick, and page 3 is read from for 1 clock tick.

Maintain a page table as an array. Use page number as an index to the array. The array should include an R-bit, an M-bit, and a Present/Absent bit, as well as the frame currently mapped.

R-bit = 1 if page has been referenced recently (read/write)
M-bit = 1 if page has been modified (needs to be written to disk)

Corresponding to the previous example, the page table could look like this way:

1 0 1 0
1 1 1 1
0 0 0 0
1 0 1 2
0 0 0 0

The first row indicates the virtual page 0 is mapped to the physical page 0. The page has been referenced and is present in the physical memory.

Assume that the R-bit is reset to 0 after a set of 6 pages have been referenced. This is to simulate a reset after each clock interrupt.

The output from the simulator should indicate whenever a fault occurs, and which page has been evicted (if one is evicted). Always select the smallest numbered page in a class to be evicted. In addition, the output should include the total number of faults that occurred.

The possible output would look something like:

: :
Fault: no page evicted, page 0 brought in to memory.
Fault: page 2 evicted, page 3 brought in to memory.
: :
Total number of faults is 23.


What to Hand In:

All programing files. (whole project solution).

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92401888
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Discuss the importance of metadata and some of the various

Discuss the importance of metadata and some of the various ways (Microsoft) SQL Server allows you to expose that information. References welcomed to learn where to find obscure IT information (books, articles, websites)

Not many applications use this type of direct connection ex

Not many applications use this type of direct connection (ex: ftp, ssh, tenet, smtp, httpd, pop) anymore unless it is within the corporate firewall. Why do you think this is? Pick 1 or 2 as example.

Question why are the error terms in cross-sectional data

Question: Why are the error terms in cross-sectional data unlikely to be serially correlated? Can you give an example in which serial correlation could be present in a cross-sectional dataset? The response must be typed, ...

Suppose you are given a connected graph g with edge costs

Suppose you are given a connected graph G, with edge costs that are all distinct. Prove that G has a unique minimum spanning tree.

Coa assignment task -q1 a the fibonacci numbers are the

COA Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of ...

Reading the biographybook where the body meets memory by

Reading the Biography Book : "Where the Body Meets Memory" by David Mura Questions: When David Mura was growing up, he tried very hard to reject his Japanese heritage. Find examples in Chapter 2 "All American Boy," and t ...

Question you are required to sort a file containing

Question : You are required to sort a file containing integers between 0 and 999999. You cannot afford to use one million pigeon-holes, so you decide instead to use one thousand pigeon-holes numbered from 0 to 999. You b ...

Birth weights of full-term babies in a certain area are

Birth weights of full-term babies in a certain area are normally distributed with mean 7.13 pounds and standard deviation 1.29 pounds. A newborn weighing 5.5 pounds or less is a low-weight baby. What is the probability t ...

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

To review stacksdirections write java code that prompts the

To review stacks Directions : Write Java code that prompts the user for a string and tells them if the grouping characters in that string are balanced. Grouping characters are ( and ), [ and ], and { and }. I got the bas ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As