In: Computer Science
On the same paper, show the work to answer the following two questions.
7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0 , 1.
Assuming demand paging with three frames, how many page faults would occur for the following replacement algorithms? Work this assignment on a piece of paper and submit an image of your work. Show your work in detail as seen in the examples in the textbook.
Difference
Between Logical and Physical Address
Physical address is an actual location in memory unit and can be
accessed physically, while the logical address is something
generated by CPU, it does not exist physically.Physical Addresses
are computed by the MMU(Memory Management Unit) whereas the logical
addresses are generated while the program is running.
Virtual
Memory
Virtual memory allows the system to compensate for memory shortage
by using secondary memory which is addressed like part of main
memory. Basically, storage spaces like hard drives or SSDs are
considered part of RAM or main memory.
Advantages
Since there is more space now, larger programs can be written,
there is reduced fragmentation and allocating the memory is easy.
Since programs are stored on virtual memory, it occupies
significantly less spac on main memory. Since I/O is less, there is
more efficient swapping of processes
2) a) First-Fit
2) b) Best-fit:
2) c) Worst-fit:
First fit performs best followed by best fit and worst-fit at last because it doesn't allow a memory request to be satisfied.
Page replacement algorithms:
Please comment in case of doubts or queries.
Kindly upvote if you found it useful :)