subject

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)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:30
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
question
Computers and Technology, 24.06.2019 06:30
Adrawing that places all lines parallel to the z axis at an angle from the horizon is 99 ! a. an oblique drawing b. a perspective drawing c. an auxiliary view d. a one-point perspective drawing
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Why do we mark tlc plates with pencil and not with pen
Answers: 2
You know the right answer?
Write a simulation to analyze different memory page replacement algorithms. you need to implement a...
Questions
question
Social Studies, 09.11.2020 23:00
question
Mathematics, 09.11.2020 23:00
question
Spanish, 09.11.2020 23:00
question
Mathematics, 09.11.2020 23:00
Questions on the website: 13722367