Sample questions
Question 1Easy
With a page size of 1 KB, what are the page number and offset of logical address 5000?
- Page 4, offset 1000
- Page 4, offset 904
- Page 3, offset 904
- Page 5, offset 0
Answer: B. Page 4, offset 904
Explanation
5000 / 1024 = 4 remainder 904
(4 x 1024 = 4096;
5000 - 4096 = 904).
Step-by-step solution
- Page size is 1 KB = 1024 bytes.
- Logical address 5000 divided by 1024 gives page number 4.
- Remainder is 904, which is the offset.
- Page number is 4 and offset is 904.
- Final answer: Page 4, offset 904.
Why the other options are wrong
- A. Offset 1000 is wrong; 5000 minus 4 pages of 1024 bytes leaves 904, not 1000.
- C. Page 3 is wrong; page 3 covers 3072 to 4095, while 5000 falls in page 4.
- D. Page 5 starts at 5120, which is past address 5000, so 5000 is not at offset 0 of page 5.
Tip: Divide address by page size; quotient is page number, remainder is offset.
Question 2Easy
In segmentation, a logical address consists of:
- A page number and a frame number
- A base and a limit
- Only a physical address
- A segment number and an offset
Answer: D. A segment number and an offset
Explanation
The segment number indexes the segment table to get base and limit; the offset is checked against the limit and added to the base.
Step-by-step solution
- Logical address has two parts: segment number and offset.
- Segment number points to the segment in the segment table.
- Offset is added to the base address from the segment table.
- This gives the physical address in memory.
- Final answer: A segment number and an offset.
Why the other options are wrong
- A. A page number and a frame number belong to paging; segmentation uses a segment number and an offset.
- B. A base and a limit are fields of the segment table, not the two parts of a logical address.
- C. A logical address is not a physical address; the CPU generates a segment number and offset, which are then translated.
Question 3Easy
In paging, physical memory is divided into fixed-size blocks called:
- Segments
- Frames
- Pages
- Sectors
Answer: B. Frames
Explanation
Logical memory is divided into pages of the same size as the physical frames.
Step-by-step solution
- Physical memory is split into fixed-size blocks.
- These blocks are called frames in paging.
- Logical memory is divided into pages matching frame size.
- Frames are the fixed-size blocks of physical memory.
- Final answer: Frames.
Why the other options are wrong
- A. Segments are variable-sized logical units, not fixed-size blocks of physical memory.
- C. Pages are fixed-size blocks of logical memory; the fixed blocks of physical memory are frames.
- D. Sectors are units on a disk, not the memory blocks used in paging.
Question 4Easy
Which memory management scheme suffers from external fragmentation?
- Inverted page tables
- Fixed-size frame allocation
- Paging
- Segmentation
Answer: D. Segmentation
Explanation
Segments have variable sizes, so free memory can become split into many small holes between segments.
Step-by-step solution
- Segmentation divides memory into variable-sized segments.
- Free memory spaces are left between segments as they are not contiguous.
- These scattered free spaces cannot be used for new segments, causing external fragmentation.
- External fragmentation happens when free memory is not enough to satisfy a request.
- The correct answer is Segmentation.
Why the other options are wrong
- A. Inverted page tables are a paging design with fixed-size frames, so they do not suffer external fragmentation.
- B. Fixed-size frames avoid external fragmentation, because any free frame can hold any page.
- C. Paging uses fixed-size frames, so it suffers from internal fragmentation, not external fragmentation.
Tip: Remember: Segmentation causes external fragmentation due to variable segment sizes.
Question 5Medium
Paging makes sharing code between processes easy because:
- Segments are always contiguous
- Each process gets its own private copy of every shared page, so no process can modify another copy
- Several page tables can point to the same frames holding reentrant code
- Pages are never in memory
Answer: C. Several page tables can point to the same frames holding reentrant code
Explanation
Read-only (reentrant) code such as a shared library can be mapped into many address spaces at once.
Step-by-step solution
- Paging lets several page tables map the same physical frames.
- If the shared code is reentrant, the same frames can be used by all processes.
- So option C is correct.
Why the other options are wrong
- A. Contiguous segments are about segmentation, not paging sharing.
- B. A private copy per process means no sharing at all.
- D. Pages are usually in memory when they are used.
Tip: Shared code = same frames mapped in many page tables.
Question 6Medium
The page size is 1 KB. Logical address 3085 lies in a page that is mapped to frame 7. What is the physical address?
- 3085
- 10253
- 7168
- 7181
Answer: D. 7181
Explanation
Page number = 3085 div 1024 = 3, offset = 3085 mod 1024 = 13.
Physical address = 7 x 1024 + 13 = 7181.
Step-by-step solution
- Page size is 1 KB = 1024 bytes.
- Logical address 3085 divided by 1024 gives page number 3.
- Offset is 3085 mod 1024 = 13.
- Frame number is 7, so physical address = 7 * 1024 + 13 = 7181.
- Final answer: 7181.
Why the other options are wrong
- A. 3085 is the logical address; the physical address is frame 7 times 1024 plus the offset 13, which is 7181.
- B. 10253 would be frame 10 plus offset 13; the page is frame 7, so the physical address is 7181.
- C. 7168 is only the start of frame 7; the offset 13 must be added, giving 7181.
Question 7Medium
Compaction solves external fragmentation, but it is only possible when:
- Addresses are bound at compile time
- Processes never perform I/O
- Relocation is dynamic (done at execution time)
- The system uses no MMU
Answer: C. Relocation is dynamic (done at execution time)
Explanation
Moving processes requires updating their base registers, which works only with execution-time binding.
Step-by-step solution
- Compaction moves processes in memory to join free holes.
- Moving a process is only safe when its addresses can be relocated at run time.
- So compaction needs dynamic relocation, option C.
Why the other options are wrong
- A. Compile-time binding fixes addresses, so processes cannot be moved.
- B. I/O has no bearing on whether compaction is possible.
- D. Without any relocation support, compaction cannot happen.
Tip: Compaction needs run-time relocation.
Question 8Medium
TLB lookup takes 20 ns and a memory access 100 ns, with a single-level page table. What TLB hit ratio gives an effective access time of 140 ns?
- 75%
- 90%
- 80%
- 60%
Answer: C. 80%
Explanation
EAT = h(120) + (1 - h)(220) = 220 - 100h.
Setting 220 - 100h = 140 gives h = 0.8.
Step-by-step solution
- With a hit, time is TLB + one memory access = 20 + 100 = 120 ns.
- With a miss, time is TLB + page-table access + data access = 20 + 100 + 100 = 220 ns.
- Effective time = 120h + 220(1 − h) = 220 − 100h, where h is the hit ratio.
- Setting 220 − 100h = 140 gives h = 0.8, so 80%, option C.
Why the other options are wrong
- A. 75% gives 145 ns, not 140 ns.
- B. 90% gives 130 ns, not 140 ns.
- D. 60% gives 160 ns, not 140 ns.
Tip: EAT = hit × hit time + miss × miss time; solve for the unknown.
Question 9Hard
Segmentation with paging (as in classic x86) combines:
- Fixed partitions with best fit
- Contiguous allocation of each segment with swapping of whole processes
- Two different TLBs for each process
- A logical view of segments with paging to avoid external fragmentation
Answer: D. A logical view of segments with paging to avoid external fragmentation
Explanation
Segments give a programmer-friendly structure and protection; paging each segment removes the need for contiguous memory.
Step-by-step solution
- Segmentation gives a logical program view.
- Each segment is divided into pages.
- This avoids external fragmentation.
Why the other options are wrong
- A. Unrelated.
- B. This is plain segmentation with swapping.
- C. The scheme does not need two TLBs.
Question 10Hard
A 32-bit system uses two-level paging with 4 KB pages and 4-byte entries, and each second-level page table fills exactly one page. How is the virtual address split?
- 12 bits outer, 8 bits inner, 12 bits offset
- 8 bits outer, 12 bits inner, 12 bits offset
- 16 bits outer, 16 bits offset
- 10 bits outer index, 10 bits inner index, 12 bits offset
Answer: D. 10 bits outer index, 10 bits inner index, 12 bits offset
Explanation
Offset = log2(4096) = 12 bits.
A page holds 4096/4 = 1024 entries, so the inner index is 10 bits, leaving 32 - 22 = 10 bits for the outer index.
Step-by-step solution
- Page size 4 KB gives a 12-bit offset.
- A page table fits one page: 4096 / 4 = 1024 entries.
- 1024 entries means 10 bits for the inner index.
- Remaining 32 - 12 - 10 = 10 bits for the outer index.
Why the other options are wrong
- A. Swaps the splits and uses 8 bits that do not match 1024 entries.
- B. An inner index of 12 bits would need 4096 entries per table.
- C. This is single-level paging, not two-level.
Tip: Index bits = log2(page size / entry size).
Practise all 46 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →