0% found this document useful (0 votes)
64 views

Os Assisnment 4

OS4

Uploaded by

gauravsingh92921
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Os Assisnment 4

OS4

Uploaded by

gauravsingh92921
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment-4

Note: Attempt all questions and give the logical answer in a precise manner.

Q1. Consider the following two-dimensional array D in the C programming language, which is
stored in row-major order:

int D[128][128];
Demand paging is used for allocating memory and each physical page frame holds 512
elements of the array D. The Least Recently Used (LRU) page-replacement policy is used by
the operating system. A total of 30 physical page frames are allocated to a process that
executes the following code snippet:

for (int i = 0; i < 128; i++)


{
for (int j = 0; j < 128; j++)
{
D[j][i] *= 10;

}
}
What is the number of page faults generated during the execution of this code snippet?

Q2. Consider a paging system with the page table stored in memory.

a. If a memory reference takes 200 nanoseconds, how long does a paged memory reference take?

b. If we add TLBs, and 75 percent of all page-table references are found in the TLBs, what is the
effective memory reference time? (Assume that finding a page-table entry in the TLBs takes zero time
if the entry is there.)

Q3. Compare paging with segmentation with respect to the amount of memory required by the
address translation structures in order to convert virtual addresses to physical addresses.

Q4. Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (ill order), how would
the first-fit, best-fit, and worst-fit algorithms place processes of 212 KB, 417 KB, 112 KB, and 426 KB
(in order)? Which algorithm makes the most efficient use of memory?

Q5. Consider a logical address space of 64 pages of 1,024 words each, mapped onto a physical memory
of 32 frames.

a. How many bits are there in the logical address?


b. How many bits are there in the physical address?

Q6. Consider a computer system with a 32-bit logical address and 4-KB page size. The system supports
up to 512MB of physical memory. How many entries are there in each of the following?

a. A conventional single-level page table

b. An inverted page table

Q7. Consider a logical address space of 32 pages with 1,024 words per page, mapped onto a physical
memory of 16 frames.

a. How many bits are required in. the logical address?

b. How many bits are required in the physical address?

Q8. Explain the concept of paging. Also, explain paging hardware support using TLB with a suitable
diagram.

Q9. Explain the concept of demand paging. Consider the given references to the following pages by a
program: 0,9,0,1,8,1,8,7,8,7,1,2,8,2,7,8,2,3,8,3 How many pages faults will occur if the program has
three-page frames available to it and uses:

(i) FIFO replacement

(ii) LRU replacement

(iii) Optimal replacement

Q10. Explain the terms hit ratio and miss ratio. On a simple paged system, associative registers hold
the most active page entries and the full-page table is stored in main memory. If references satisfied
by associative registers take 100ns, and references through the main memory page table take 180 ns,
what must the hit ratio be to achieve an effective access time of 125 ns?

You might also like