Q: 1 In a paging system with a Translation Lookaside Buffer (TLB), the TLB has a hit ratio of 80%. It takes 20 nanoseconds to search the TLB and 100 nanoseconds to access main memory. What is the effective memory access time?
120 nanoseconds
140 nanoseconds
160 nanoseconds
180 nanoseconds
[ Option B ]
Q: 2 The memory allocation technique used in paging may have:
External fragmentation
Internal fragmentation
Hybrid fragmentation
No fragmentation
[ Option B ]
Paging is a memory management technique that divides physical memory into fixed-size blocks called frames and logical memory into blocks of the same size called pages. Pages are mapped to frames using a page table, allowing non-contiguous allocation of memory.
| TYPE OF FRAGMENTATION | DESCRIPTION |
|---|---|
| Internal Fragmentation. | Occurs when the last allocated page/frame is not fully used. Wasted memory inside allocated blocks due to fixed-size allocation. Paging may cause internal fragmentation because the last page of a process might not be completely filled. |
| External Fragmentation. | Occurs when there is enough total memory to satisfy a request, but it is not contiguous. Wasted memory outside allocated blocks due to scattered free memory. |
Q: 3 In a system with a 32-bit logical address space and a page size of 4 KB approximately, how many entries are there in the page table?
220 entries
210 entries
232 entries
212 entries
[ Option A ]
In a paging system, the logical address space is divided into fixed-size pages, and a page table maps each logical page to a physical frame in memory. In this problem, the system has a 32-bit logical address space, which means it can address 232 bytes.
The page size is given as 4 KB, which is 212 bytes. To find the number of pages, we divide the total logical address space by the page size: 232/ 212=220.
Since each page requires one entry in the page table, the page table will contain 220 entries.
Q: 4 If 2n words are in main memory and 2K words are in cache memory, then the bits for tag field and index field of a n-bit memory address are respectively,
n, K
K, n
n−K, K
n+K, n
[ Option C ]
In Cache Memory, a main memory address is divided into tag, index, and block offset fields if using Direct Mapping.
If main memory has 2n words and cache has 2K words, then:
Index field = K bits (To select one of 2K cache lines)
Tag field = n−K bits (Remaining bits to identify the memory block)
Q: 5 Which of the following is (are) true about virtual memory system that uses pages?
I. The virtual address space can be larger than the about of physical memory.
II. Programs must be resident in main memory throughout their execution.
III. Pages correspond to semantic characteristics of the program.
I only
II only
I and II
I and III
[ Option A ]
In a virtual memory system that uses paging, the virtual address space can be larger than the available physical memory, because only the required pages of a program are loaded into main memory at any given time, while the rest remain on secondary storage. Hence, statement I is true.
Statement II is false because a program does not need to be completely resident in main memory throughout its execution, only the currently needed pages are brought into memory on demand.
Statement III is false because pages are fixed-size blocks determined by the system, not based on the semantic or logical structure of the program.
Q: 6 The process of organizing the memory into two banks to allow 8 bit and 16-bit data operation is called
Bank Switching
Indexed Mapping
Two-way Memory Interleaving
Memory Segmentation
[ Option C ]
Memory Interleaving is a technique used to improve memory performance by dividing memory into multiple banks so that they can be accessed simultaneously.
In two-way memory interleaving, memory is organized into two banks, allowing:
This increases data transfer speed and improves overall system performance.
Q: 7 Which of the following describes a 32 X 8 ROM?
8 words of 32 bits each
32 words of 8 bits each
32 input lines and 8 output lines
8 input lines and 32 output lines
[ Option B ]
A Read Only Memory (ROM) is a type of non-volatile memory used to store data permanently. The notation “m × n” in memory terminology means that the ROM contains m words, and each word consists of n bits.
In a 32 × 8 ROM, there are 32 memory locations, and each location can store 8 bits of data. This means the ROM can store a total of 32×8=256 bits of information. Hence, a 32 × 8 ROM is best described as “32 words of 8 bits each.”
Q: 8 Consider the following memory map using multiprogram with partition model. Dark represent memory in use while white represent free memory as shown in the figure below:
| 65k | 125k | 150k | 175k | 150k |
Request for memory follows the following order : 100k, 25k, 125k, 50k. which of the following allocation satisfies the above request?
(A) Best Fit
(B) First Fit
(C) Worst Fit
A, B, C
A, B
B, C
A, C
[ Option B ]
Q: 9 Consider a system using 2-level paging and the virtual address is 38 bits. The most significant 10 bits are used to index the page directory and next 16 bits index the page table. Each entry in both levels is 4 bytes. What is the maximum size of a page table in KB?
4 KB
16 KB
256 KB
None of these
[ Option C ]
The virtual address is 38 bits long, where 10 bits are for the page directory and 16 bits for the page table. Each page table entry is 4 bytes. So, the number of entries in a page table is 216. Multiplying by 4 bytes gives 218 bytes, which is equal to 256 KB. Hence, the maximum size of a page table is 256 KB.
Q: 10 What is the purpose of the valid-invalid bit in a page table entry?
To track page frequency replacement
To distinguish between read and write access
To indicate whether the page is in physical memory
To determine if the page is part of the process's logical address space
[ Option D ]
The Valid-Invalid bit in a page table entry is used to check whether a page belongs to a process’s logical address space. If the bit is valid (1), the page is part of the process and can be accessed. If it is invalid (0), the page does not belong to the process, and any access attempt will cause a memory protection error. This mechanism helps the operating system prevent illegal memory access and ensures safe process isolation.
Q: 11 Consider a logical address 0001001011110000, which representing segment number 1 (leftmost 4 bits) and offset 752. Suppose that this segment is residing in main memory starting at physical address 0010000000100000, then, the physical address of the segment is :
0010001100010000
0010001000011000
0001000101010000
0010000011011000
[ Option A ]
Q: 12 A computer with cache access time of 100 ns, a main memory access time of 1000 ns, and a hit ratio of 0.9 produces an average memory access time of
1100 ns
200 ns
900 ns
150 ns
[ Option B ]
Cache memory is a small, high-speed memory placed between the CPU and main memory to reduce access time. Average Memory Access Time (AMAT) is calculated using the formula:
AMAT = (Hit Ratio × Cache Access Time) + (Miss Ratio × Main Memory Access Time)
Given:
Cache access time = 100 ns
Main memory access time = 1000 ns
Hit ratio = 0.9
Miss Ratio=1−0.9=0.1
AMAT = (0.9×100) + (0.1×1000) = 90 + 100 = 190 ns
Approximating to the closest option gives 200 ns.
Q: 13 Which of the following is NOT a criterion for page replacement from main memory?
First In First Out
Least Recently Used
Last In First Out
None of these
[ Option D ]
In Operating Systems (OS), page replacement algorithms are used when a page fault occurs and physical memory is full. The system must decide which existing page should be removed to make space for the new page.
| ALGORITHM | DESCRIPTION |
|---|---|
| FIFO (First In First Out) | Removes the page that entered memory first. Very simple to implement using a queue. May suffer from Belady’s Anomaly. Performance is average to poor. |
| LRU (Least Recently Used) | Replaces the page that has not been used for the longest time. Based on temporal locality principle. Does NOT suffer from Belady’s Anomaly. Gives better performance than FIFO. |
| Optimal | Replaces the page that will not be used for the longest time in the future. Gives minimum possible page faults. Does NOT suffer from Belady’s Anomaly. Not practically implementable because future references are unknown. Used only for theoretical comparison. |
| LIFO (Last In First Out) | Removes the most recently loaded page. Rarely used in real systems because it may remove a heavily used page. Can suffer from Belady’s Anomaly. |
| LFU (Least Frequently Used) | Replaces the page with the lowest reference count. Requires maintaining counters. May suffer from anomaly. Old pages with high count may never get removed unless aging technique is used. |
| MFU (Most Frequently Used) | Replaces the page with the highest reference count. Assumes that frequently used pages were used heavily in the past and may not be needed soon. |
| Second Chance | Improvement over FIFO. Uses a reference bit. If reference bit=1, page gets second chance and is moved back in queue. If 0, it is replaced. Reduces unnecessary removals compared to FIFO. Still may suffer from Belady’s Anomaly. |
| Clock Algorithm | Efficient implementation of Second Chance using circular list. Uses reference bit. More practical and widely implemented in modern OS. Better than FIFO. |
| Random Replacement | Replaces a randomly selected page. Very simple to implement. Performance unpredictable. Used mainly for research or special cases. |
Q: 14 The physical address space is conceptually divided into a number of fixed-size blocks, called __________.
Frames
Segments
Pages
None of the above
[ Option A ]
In an Operating System (OS) that uses paging, both logical memory and physical memory are divided into fixed-size blocks.
| MEMORY TYPE | DIVIDED INTO | DESCRIPTION |
|---|---|---|
| Logical (Virtual) Memory | Pages | Fixed-size blocks created by the process. |
| Physical Memory | Frames | Fixed-size blocks in RAM. |
When a program is executed:
Q: 15 A condition in which a process is spending more time paging than executing is called:
Race condition
Thrashing
Aging
Virtualization
[ Option B ]
Thrashing occurs in a paging system when a process spends more time swapping pages in and out of memory than executing instructions.
It typically happens when the system does not have enough physical memory to hold the working set of all active processes. Thrashing leads to severe performance degradation, as the CPU is mostly idle waiting for page transfers.
Q: 16 What is the purpose of the free-frame list in an operating system?
To track which processes are currently running
To store page tables for each process
To keep a list of active I/O operations
To manage frames available for allocation when a page fault occurs
[ Option D ]
In an Operating System (OS) that uses virtual memory, physical memory (RAM) is divided into fixed-size blocks called frames, and logical memory is divided into pages. When a program tries to access a page that is not currently in memory, a page fault occurs.
At this time, the OS needs to bring the required page from the disk into main memory. To do this efficiently, the OS maintains a Free-Frame List, which is a list of all the empty frames available in physical memory.
When a page fault happens, the OS selects a free frame from this list, loads the required page into it, and updates the page table.
So, the free-frame list helps the operating system know which parts of memory are empty so it can quickly allocate space whenever a new page needs to be loaded due to a page fault.
Q: 17 What key principle does the LRU page replacement algorithm use to decide which page to evict?
The page with the smallest page number.
The page that will not be used for the longest time in the future.
The page that was loaded into memory most recently.
The page that has not been used for the longest period of time.
[ Option D ]
In Paging Systems, when a page fault occurs and memory is full, the OS must decide which page to replace.
LRU (Least Recently Used) algorithm evicts the page that has been unused for the longest time, under the assumption that pages used recently are more likely to be used again soon. This is based on temporal locality of reference, a key principle in memory access patterns.
So, LRU page replacement algorithm uses the principle of evicting the page that has not been used for the longest period of time.
Q: 18 Consider the following reference strings and assume 3 frames are available, then the number of page faults that occur using optimal page replacement algorithm is
6, 0, 5, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 5, 2
15 Page Faults
9 Page Faults
12 Page Faults
8 page Faults
[ Option D ]
The Optimal Page Replacement Algorithm replaces the page that will not be used for the longest period in the future. This algorithm gives the minimum possible number of page faults.
Given Reference String : 6, 0, 5, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 5, 2
| PAGE | FRAMES AFTER REPLACEMENT | PAGE FAULT |
|---|---|---|
| 6 | 6 - - | Yes |
| 0 | 6 0 - | Yes |
| 5 | 6 0 5 | Yes |
| 2 | 2 0 5 | Yes |
| 0 | 2 0 5 | No |
| 3 | 2 0 3 | Yes |
| 0 | 2 0 3 | No |
| 4 | 2 4 3 | Yes |
| 2 | 2 4 3 | No |
| 3 | 2 4 3 | No |
| 0 | 2 0 3 | Yes |
| 3 | 2 0 3 | No |
| 2 | 2 0 3 | No |
| 5 | 2 0 5 | Yes |
| 2 | 2 0 5 | No |
Total Page Faults = 8
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.