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 12:40
How do i get the most points, without any effort?
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
These statements describe lists in presentation programs: a. bullets can be turned off and on. b. bullets cannot be turned off. c. bullet styles, colors, and sizes can be changed. d. lists don't have to use bullets or numbers. e. numbering styles, colors, and sizes can be changed. f. numbers can be turned off and on. g. numbers cannot be turned off. select all that apply
Answers: 2
question
Computers and Technology, 24.06.2019 18:00
Why is a multiview sketch drawinf different from other sketches like isometric, two point, and oblique
Answers: 1
You know the right answer?
Write a simulation to analyze different memory page replacement algorithms. you need to implement a...
Questions
question
Mathematics, 14.05.2021 23:20
Questions on the website: 13722361