Assignment 2 Os
Assignment 2 Os
OPERATING SYSTEM…
Rollno - 56
Q1: Differentiate between
a) Physical address space and logical address space:
- Physical address space: This refers to the actual
addresses that correspond to the physical memory
chips or storage devices. It represents the real locations
where data is stored or retrieved.
- Logical address space: This is the set of addresses
generated by a program. These addresses need to be
translated into physical addresses to access the actual
memory. Logical addresses are relative to the start of
the program's execution and are mapped to physical
addresses by the memory management unit (MMU)
during execution.
- **Best Fit**:
- 212K -> 300K
- 47K -> 100K
- 112K -> 200K
- 426K -> 500K
- **Worst Fit**:
- 212K -> 600K
- 47K -> 100K
- 112K -> 200K
- 426K -> 500K
Efficiency: Best Fit typically makes the most efficient
use of memory by minimizing wasted space due to
fragmentation.
Q3: Reasons
a) Logical Address:
- Given: 256 pages (2^8 pages) and page size of 2^10
bytes.
- Number of bits for logical address = Page number
bits + Page offset bits
- Page number bits = log2(256) = 8 bits
- Page offset bits = log2(2^10) = 10 bits
- Total bits in logical address = 8 (page number) + 10
(page offset) = 18 bits
b) Page Frame Size:
- Page size = 2^10 bytes
- Number of bytes in a page frame = 2^10 bytes =
1024 bytes
c) Physical Address:
- Physical memory = 2^24 bytes
- Number of page frames = Physical memory size /
Page size = 2^24 bytes / 2^10 bytes = 2^14 page frames
- Number of bits for physical address specifying the
page frame = log2(2^14) = 14 bits
Given:
- Overhead without associative memory = 500 nsec
- Overhead with associative memory = 100 nsec
- Desired mean overhead = 200 nsec
Q7: Concepts
Page Faults:
- Optimal: 7 page faults
- FIFO: 9 page faults
- LRU: 8 page faults