Question

How much internal fragmentation would you have - in paging Cassume a page size of n...

How much internal fragmentation would you have - in paging Cassume a page size of n bytes) in

a) the best case

b) worst case

c) average case

2‌)‌ ‌Assuming‌ ‌a‌ ‌page‌ ‌size‌ ‌of‌ ‌100‌ ‌bytes‌ ‌in‌ ‌paging‌,‌ ‌‌it‌ ‌a‌ ‌program‌ ‌

references‌ ‌logical‌ ‌address‌ ‌235‌,‌ ‌‌tell‌ ‌me:‌ ‌ ‌

a)‌ ‌what‌ ‌the‌ ‌page‌ ‌number‌ ‌and‌ ‌the‌ ‌offset‌ ‌ ‌

(displacement)‌ ‌will‌ ‌be‌ ‌ ‌

b)describe‌ ‌how‌ ‌the‌ ‌page‌ ‌number‌ ‌and‌ ‌the‌ ‌offset‌ ‌‌will‌ ‌be‌ ‌‌used‌ ‌to‌ ‌

come‌ ‌up‌ ‌with‌ ‌the‌ ‌actual‌ ‌physical‌ ‌address‌ ‌and‌ ‌how‌ ‌many‌ ‌

memory‌ ‌accesses‌ ‌will‌ ‌required‌ ‌to‌ ‌do‌ ‌that‌ ‌

Homework Answers

Answer #1

Que:- How much internal fragmentation would you have - in paging (assume a page size of n bytes) in

a) the best case

b) worst case

c) average case

Ans:- It is given that size of a page in paging memory management technique in OS is n bytes

a) In best case there will 0 (zero) byte internal fragmentation, It can be the case when the process size is the multiple of page size. (For example if process of size 400 bytes and the page size is of 100 bytes then there will be exactly 4 pages required to accomodate the process.

b) In worst case there will (n- 1) bytes internal fragmentation, It can be the case when the process required M whole pages plus one byte, in such case total number of pages required (M+1). In M+1th page only 1 byte will be used and remaining n-1 bytes will be internal fragmentation.

c) In average case there will be n/2 bytes internal fragementation. In such case last page of the process will be half filled and remaining half page will be internal fragmentation.

Que 2‌)‌ ‌Assuming‌ ‌a‌ ‌page‌ ‌size‌ ‌of‌ ‌100‌ ‌bytes‌ ‌in‌ ‌paging‌,‌ ‌‌if‌ ‌a‌ ‌program‌ references‌ ‌logical‌ ‌address‌ ‌235‌,‌ ‌‌tell‌ ‌me:‌ ‌

a)‌ ‌what‌ ‌the‌ ‌page‌ ‌number‌ ‌and‌ ‌the‌ ‌offset‌ ‌ ‌(displacement)‌ ‌will‌ ‌be‌ ‌ ‌?

b) Describe‌ ‌how‌ ‌the‌ ‌page‌ ‌number‌ ‌and‌ ‌the‌ ‌offset‌ ‌‌will‌ ‌be‌ ‌‌used‌ ‌to‌ ‌come‌ ‌up‌ ‌with‌ ‌the‌ ‌actual‌ ‌physical‌ ‌address‌ ‌and‌ ‌how‌ ‌many‌ ‌ memory‌ ‌accesses‌ ‌will‌ ‌required‌ ‌to‌ ‌do‌ ‌that‌?

Ans-2:-  ‌GIven that

page size =100

Logical address (referenced by program) A= 235

a) The logical address will be at 3rd page (because as page size is 100, logical addresses 0-99 will be at PAGE0, 100-199 will be PAGE1, 200-299 will be at PAGE2.

So page number will be 2, because in paging page numbers starts from 0 (Zero).

Offset = A mod Page_size

= 235 mod 100

= 35

b) To obtain the physical address first we see the frame number in the page table. multiply (Frame number-1) by page size then add the offset in that. By that way way we can calculate the physical address and access the particular logical address on a particular page in the main memory.

For accessing a logical address

Step-1: first we find the page number on the basis of page size. (Page# = logical address/Page_size)

Step-2: Search the Page map table in the memory and check whether it is in main memory or not on the basis of bit.

Step-3: If it is there then directly access the logical address else there will be a page fault and first that page will be swap into the main memory from the secondary storage and make the entry in PMT and access the address at the page in that particular frame in the main memory.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What are some advantages and disadvantages of selecting a page frame size of 1 MB? List...
What are some advantages and disadvantages of selecting a page frame size of 1 MB? List at least one (1) advantage and disadvantage. What are some advantages and disadvantages of selecting a page frame size of 100 bytes? List at least one (1) advantage and disadvantage. Answer the following questions about a program containing 512 bytes and an operating system using a page frame size of 200 bytes. How many page frames are necessary to store the entire program in...
15. A large page size results in A) lower internal fragmentation B) larger page table overhead...
15. A large page size results in A) lower internal fragmentation B) larger page table overhead C) efficient disk I/O D) All of the above
Problem 8 Given five memory partitions of 100 KB, 200 KB, 600 KB, 450 KB, and...
Problem 8 Given five memory partitions of 100 KB, 200 KB, 600 KB, 450 KB, and 400 KB (in order - shown in figure below), how would the first-fit, best-fit, and worst-fit algorithms place processes of 100 KB, 75 KB, 380 KB, 555 KB and 326 KB (in order)? If one process will not fit you can list their partition as NULL. Which algorithm makes the most efficient use of memory? To make this decision, calculate the total fragmentation (external...
how would you use the Cholesky factorization to obtain an IID sample of size n from...
how would you use the Cholesky factorization to obtain an IID sample of size n from the Np(c,Σ) distribution?
You would like to have $600,000 when you retire in 35 years. How much should you...
You would like to have $600,000 when you retire in 35 years. How much should you invest each quarter if you can earn a rate of 2.4% compounded quarterly? a) How much should you deposit each quarter? $ b) How much total money will you put into the account? $ c) How much total interest will you earn?
You would like to have $800,000 when you retire in 30 years. How much should you...
You would like to have $800,000 when you retire in 30 years. How much should you invest each quarter if you can earn a rate of 7.1% compounded quarterly? a) How much should you deposit each quarter? $ b) How much total money will you put into the account? $ c) How much total interest will you earn?
a. How much would you have to deposit today if you wanted to have $42,000 in...
a. How much would you have to deposit today if you wanted to have $42,000 in three years? Annual interest rate is 10%. (PV of $1, FV of $1, PVA of $1, and FVA of $1) (Use appropriate factor(s) from the tables provided. Round your answer to the nearest whole dollar.)    b. Assume that you are saving up for a trip around the world when you graduate in two years. If you can earn 6% on your investments, how...
If the confidence level is 99% and sample size is 36, how much is t(1-α/2, n-1)?...
If the confidence level is 99% and sample size is 36, how much is t(1-α/2, n-1)? A. 2.0639 B. 2.0595 C. 2.7238 D. 2.7195
On the average, how much would you expect to win by playing the following game? A...
On the average, how much would you expect to win by playing the following game? A 50% chance to win $2000, a 30% chance to lose $1000, and a 20% chance to lose $2000. a) $1000 gain b) $300 loss c) $400 loss d) $300 gain On the average, how much would you expect to win by playing the following game? A 60% chance to win $3000 and a 40% chance to lose $1000. a) $1800 gain b) $400 loss...
If you would like to load 10 µL of your sample onto a SDS-PAGE gel, how...
If you would like to load 10 µL of your sample onto a SDS-PAGE gel, how much 6X Laemmli dye would you need to add to your sample?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT