Computers and Technology

Write a simulation to analyze different memory page replacement algorithms. you need to implement a simple simulator of page replacement policies, assuming a single running process and a fxed size physical memory. overview you simulator should allow the page size and physical memory size (# of address bits) as command-line arguments. the simulation should support at least three page replacement policies: random, fifo, and lru. the page size must be a number of power of 2 between 256 (2^8) and 8192 (2^13) bytes inclusively. the physical memory size is also power of 2. assume that when the simulation start, the physical memory is empty, i. e. all page table entries are invalid. as they are brought in, the simulator should make sure that the total number of pages in memory should never exceed the physical memory size. the simulator should read a sequence of logical memory references from a file (references. txt). this file contains a list of virtual (logical) memory byte addresses accessed by a program. in this simulation, the maximum virtual memory address is 128 mb (2 27bytes) and the number of addresses in the file is 5,000,000. in this simulation, the least significant bit is used to differentiate between a read access (0, i. e. even number) or write access (1, i. e. odd number). for example, the value 1220149 means a write reference to memory location 1220148. those addresses can be assumed to be aligned at a two-byte boundary, i. e., they are always even. we can safely play this simple trick because the minimum page size is 256 bytes, so the eight least significant bits of an address are irrelevant to the page number anyway. your program should keep track of pages in the memory and free frames. therefore you need to maintain a pagetable data structure, which can be easily implemented as an array of page-table entries, and a free-frame list. the number of pages is dependent on the page size. in the pagetable entry data structure, you need additional fields, e. g. valid and dirty bits, besides the mapped frame number of the page. for each memory reference, find out its page number and whether this page is in the main memory. if the memory reference is a write, this page is marked dirty. if this page is not in the main memory, a page fault is generated and this page is loaded into the main memory. however, if the main memory is full, a victim page must be selected and evicted according a page replacement algorithm. your simulation is to compare different page replacement algorithms. notice you may need to keep track of additional information such as last page access time for the lru (least recently used) algorithm.

required output

• this program should collect and print the following statistics for different algorithms: the total number of memory references. the total number of page faults. the total number of flushes, i. e., cases when the victim page was dirty. the total time it took the simulator to produce the results. • in addition to a program printout, the results of algorithm should be analyzed and written in the reprot. you should thoroughly test your program with several different page sizes (256 - 8192 bytes) and physical memory sizes (e. g. 4 mb, 16 mb, 32 mb, 64 mb)

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, terriblexsiren
You receive an email from an impressive-sounding stranger, professor alexander rothschild renard iii, president of the american institute for scientific political statesmen. he urges you to vote for his presidential candidate choice. this social media red flag is known as
Answers: 1
image
Computers and Technology, 22.06.2019 17:20, Korkot7633
[a] create a class called “cycle” which has two instance integer variables as properties, “numberofwheels” and “weight.” create a constructor with two parameters, using the same variable names in the parameter list. assign each variable to numberofwheels” and “weight” respectively. write a separate application to test the class and display its properties. note: do not change the names of the instance variables or the variables listed in the constructor’s parameter list. [b] edit your class cycle by adding a default constructor which will assign the default values of 100 to represent the numberofwheels, and 1000 to represent the weight, by invoking a call to the other constructor. modify your application created in [a] to test the class.
Answers: 3
image
Computers and Technology, 22.06.2019 17:50, ImBADatmath8743
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
image
Computers and Technology, 24.06.2019 03:00, SiegeHatake4534
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
Do you know the correct answer?
Write a simulation to analyze different memory page replacement algorithms. you need to implement a...

Questions in other subjects: