Professional Documents
Culture Documents
1.If there are 32 segments, each size 1 k bytes, then the logical address should have
Solution:
Logical Address
s d
5
32(2 ) 1K=1024(210)
b) Physical Address
f d
32(25) 1024(210)
No. of bits in physical address =5+10
=15 bits
3. Consider a logical address space of 256 pages with a 4-KB page size,
mapped onto a physical memory of 64 frames.
a. How many bits are required in the logical address?
b. How many bits are required in the physical address?
Solution:
b) Physical Address
f d
64(26) 4K=4*1024(212)
No. of bits in physical address =6+12
=18 bits
4.Consider a system with byte-addressable memory, 32-bit logical addresses, 4
kilobyte page size and page table entries of 4 bytes each. The physical address space of
the system in megabytes is ___________
Solution
5.Consider a machine with 64 MB physical memory and a 32-bit virtual address space.
If the page size is 4KB, what is the approximate size of the page table?
Solution
Number of entries in page table = (virtual address space size)/(page size)=2 32 /212 =220
No. of bits required to address the 64MB Physical memory = 26.
No. of page frames in the physical memory =2 (26-12) = 214
Each page table entry will contain 14 bits address of the page frame and 1 bit for valid-
invalid bit.
Since memory is byte addressable,we take that each page table entry is 16 bits i.e. 2 bytes
long.
Size of page table = (total number of page table entries) *(size of a page table entry)
= (2 20 *2) = 2MB
6. What is the size of the physical address space in a paging system which has a page
table containing 64 entries of 11 bit each (including valid and invalid bit) and a page
size of 512 bytes?
Solution:
Size of Physical Address = Paging bits + Offset bits
Paging bits = 11 – 1 = 10 (As 1 valid bit is also included)
Offset bits = log 2page size = 9
Size of Physical Address = 10 + 9 = 19 bits
size of the physical address space= 2 19
7.Consider a computer system with 40-bit virtual addressing and page size of sixteen
kilobytes. If the computer system has a one-level page table per process and each page
table entry requires 48 bits, then the size of the per-process page table is
_________megabytes.
Solution
Virtual address space = 2 40
Page size = 16KB = 214
No of pages= Virtual address space / page size = 2 40 / 214 = 226
Solution
If any page request comes it will first search into page table, if present, then it will directly
fetch the page from memory, thus in this case time requires will be only memory access
time.
But if required page will not be found, first we have to bring it out and then go for memory
access. This extra time is called page fault service time.
Let hit ratio be p , memory access time be t1 , and page fault service time be t2.
Hence, average memory access time = p*t1 + (1-p)*t2
=(99.99*1 + 0.01*(10*1000 + 1))/100
=1.9999 *10^-6 sec
13. Let the page fault service time be 10ms in a computer with average memory access
time being 20ns. If one page fault is generated for every 10^6 memory accesses, what
is the effective access time for the memory?
Solution
Let P be the page fault rate
Effective Memory Access Time = p *(page fault service time) (1-p) *(Memory access time)
= ( 1/(10^6) )* 10 * (10^6) ns + (1 - 1/(10^6)) * 20 ns [1ms=10^6 ns]
= 30 ns (approx)
14. Consider six memory partitions of size 200 KB, 400 KB, 600 KB, 500 KB, 300 KB,
and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four
processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. If the best fit
algorithm is used, which partitions are NOT allotted to any process?
Solution
Best fit allocates the smallest block among those that are large enough for the new process.
So the memory blocks are allocated in below order.
357 ---> 400
210 ---> 250
468 ---> 500
491 ---> 600
Sot the remaining blocks are of 200 KB and 300 KB
Average access time = 6 + 72
Average access time = 78.
15.Suppose that the virtual Address space has eight pages and physical memory with
four-page frames. If LRU page replacement algorithm is used, _____ number of page
faults occur with the reference string.
021354637473355311172341
Solution
0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1
0 0 0 0 5 5 5 7 7 7 7 7 1
2 2 2 2 4 4 4 4 1 1 4 4
1 1 1 1 6 6 5 5 2 2 2
3 3 3 3 3 3 3 3 3 3