Exam Module Subscription Required
You need an active Exam Module Subscription to access this content. Subscribe now to unlock the exam materials and continue your preparation.
Previous Job Question: Paging in Operating System
Previous Job Question: Paging in Operating System
- ☆1Operating SystemPagingDifferentiate between Logical Address and Physical Address in context of Operating System.Combined Bank, AE(IT)/AME, 26 | AME/ANE/AE
Difference Between Logical Address and Physical Address
- Definition: Logical Address is generated by CPU; Physical Address is the actual location in memory (RAM).
- Visibility: Logical Address is visible to the user/program; Physical Address is not directly visible to the user.
- Generation: Logical Address is created during program execution; Physical Address is obtained after address translation.
- Translation: Logical Address is converted to Physical Address using MMU (Memory Management Unit).
- Address Space: Logical Address Space is virtual; Physical Address Space is real memory.
- Access: CPU uses Logical Address; Memory hardware uses Physical Address.
Logical Address এবং Physical Address এর পার্থক্য
- সংজ্ঞা: Logical Address CPU তৈরি করে; Physical Address হলো RAM-এর আসল location।
- দৃশ্যমানতা: Logical Address program/user দেখতে পারে; Physical Address সরাসরি দেখা যায় না।
- উৎপত্তি: Logical Address program চলাকালে তৈরি হয়; Physical Address translation এর পরে পাওয়া যায়।
- রূপান্তর: Logical Address কে Physical Address-এ রূপান্তর করে MMU (Memory Management Unit)।
- Address Space: Logical Address Space virtual; Physical Address Space বাস্তব memory।
- ব্যবহার: CPU Logical Address ব্যবহার করে; Memory hardware Physical Address ব্যবহার করে।
- ☆2Operating SystemPagingConsider a machine with 64 MB physical memory and a 32 bit virtual address space. If the page size is 4 KB, what is the approximate size of the page table.CB, AE(IT)/AHME/SO, 21 | AME/ANE/AE
Physical Address Space = 64MB = \(2^{26}\text{B}\)
Virtual Address = 32-bits, \(\therefore\) Virtual Address Space = \(2^{32}\text{B}\)
Page Size = 4KB = \(2^{12}\text{B}\)
Number of pages = \(\frac{2^{32}}{2^{12}} = 2^{20}\) pages.
Number of frames = \(\frac{2^{26}}{2^{12}} = 2^{14}\) frames.
\(\therefore\) Page Table Size = \(2^{20} \times 14\text{-bits} \approx 2^{20} \times 16\text{-bits} \approx 2^{20} \times 2\text{B} = 2\text{MB}\).
Physical Address Space = 64MB = \(2^{26}\text{B}\)
Virtual Address = 32-bits, \(\therefore\) Virtual Address Space = \(2^{32}\text{B}\)
Page Size = 4KB = \(2^{12}\text{B}\)
Number of pages = \(\frac{2^{32}}{2^{12}} = 2^{20}\) pages.
Number of frames = \(\frac{2^{26}}{2^{12}} = 2^{14}\) frames.
\(\therefore\) Page Table Size = \(2^{20} \times 14\text{-bits} \approx 2^{20} \times 16\text{-bits} \approx 2^{20} \times 2\text{B} = 2\text{MB}\).
- ☆3Operating SystemPagingA system utilizes a 32-bit logical address space and a page size of 220 bytes. If each entry (block) in the Translation Lookaside Buffer (TLB) requires 6 bytes, calculate the total memory required for the TLB to map the entire logical address space.Combined Bank, AP-23, 26 | Assistant Programmer
Given:
- Logical address space = 32-bit
- Page size = 220 bytes
- TLB entry size = 6 bytes per entry
Step 1: Calculate Total Logical Address Space
A 32-bit address can reference 232 unique bytes.
Total logical address space = 232 bytesStep 2: Calculate Number of Pages
Number of pages = Total address space ÷ Page size
Number of pages = 232 ÷ 220 = 2(32 − 20) = 212 = 4096 pagesStep 3: Calculate Total TLB Memory
Each page requires one TLB entry to map the entire logical address space.
Total TLB memory = Number of pages × Entry size
Total TLB memory = 4096 × 6 = 24576 bytesIn kilobytes: 24576 ÷ 1024 = 24 KB
- ☆4Operating SystemPagingConsider a logical address space of 512 pages, each of 2-KB page size, mapped onto a physical memory containing 128 frames.
a. How many bits are required in the logical address?
b. How many bits are required in the physical address? (10 Marks)Combined Bank, SO-IT, 25 | Senior Officer (IT)Given
Logical address space = 512 pages
Page size = 2 KB = 2048 bytes
Physical memory = 128 framesa) Bits required in the Logical Address
Number of pages = 512 = 29 → Page number bits = 9 bits
Page size = 2048 bytes = 211 → Offset bits = 11 bits
So, Logical address bits = Page number bits + Offset bits = 9 + 11 = 20 bitsb) Bits required in the Physical Address
Number of frames = 128 = 27 → Frame number bits = 7 bits
Offset remains same = 11 bits
So, Physical address bits = Frame number bits + Offset bits = 7 + 11 = 18 bitsপ্রদত্ত তথ্য
Logical address space = 512 pages
Page size = 2 KB = 2048 bytes
Physical memory = 128 framesa) Logical Address এর জন্য কত bit লাগবে
Page সংখ্যা = 512 = 29 → Page number এর জন্য লাগবে 9 bit
Page size = 2048 bytes = 211 → Offset এর জন্য লাগবে 11 bit
সুতরাং Logical address bits = 9 + 11 = 20 bitb) Physical Address এর জন্য কত bit লাগবে
Frame সংখ্যা = 128 = 27 → Frame number এর জন্য লাগবে 7 bit
Offset একই থাকবে = 11 bit
সুতরাং Physical address bits = 7 + 11 = 18 bit
