GATE 2001
60 questions
MCQ 601-mark 60
Questions 51–55 of 60
Consider 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 ?
Answer: (C)
The virtual address space is bytes and a page is bytes. So the number of pages is . The page table needs one entry for each page, so it has entries.
Physical memory is bytes, so a physical address has 26 bits. Subtract the 12 offset bits, so the frame number needs bits. So each entry needs at least 14 bits, which we round up to 2 bytes.
Page table size . (With exactly 14 bits per entry it would be , and the nearest option is still 2 MB.)
Answer: (C)
Physical memory is bytes, so a physical address has 26 bits. Subtract the 12 offset bits, so the frame number needs bits. So each entry needs at least 14 bits, which we round up to 2 bytes.
Page table size . (With exactly 14 bits per entry it would be , and the nearest option is still 2 MB.)
Answer: (C)
Consider a virtual memory system with FIFO page replacement policy. For an arbitrary page access pattern, increasing the number of page frames in main memory will.
Answer: (C)
This is Belady's anomaly. With FIFO, for some reference strings, adding page frames gives more page faults, not fewer.
Example: reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5.
With 3 frames, FIFO gives 9 faults (faults on 1, 2, 3, 4, 1, 2, 5, 3, 4).
With 4 frames, FIFO gives 10 faults (faults on 1, 2, 3, 4, 5, 1, 2, 3, 4, 5).
So more frames gave more faults here.
So (A) and (B) are wrong because the number of faults does not always go down, and it does not always go up (for most strings more frames give fewer faults). (D) is wrong because the number of frames clearly affects the faults. The right choice is that more frames sometimes increase the faults.
Answer: (C)
Example: reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5.
With 3 frames, FIFO gives 9 faults (faults on 1, 2, 3, 4, 1, 2, 5, 3, 4).
With 4 frames, FIFO gives 10 faults (faults on 1, 2, 3, 4, 5, 1, 2, 3, 4, 5).
So more frames gave more faults here.
So (A) and (B) are wrong because the number of faults does not always go down, and it does not always go up (for most strings more frames give fewer faults). (D) is wrong because the number of frames clearly affects the faults. The right choice is that more frames sometimes increase the faults.
Answer: (C)
Which of the following statements is false ?
Answer: (D)
(A) True. The MMU translates a program's virtual addresses to physical addresses.
(B) True. Only the pages in use need to be in main memory, so a program can be larger than main memory.
(C) True. A process needs only part of its pages in memory, so more processes fit in memory at once. This raises the degree of multiprogramming.
(D) False. On a context switch the OS must also switch to the new process's page table, and the cached translations in the TLB may have to be flushed, so the new process starts with TLB misses. Virtual memory adds to the context switching cost; it does not reduce it.
Answer: (D)
(B) True. Only the pages in use need to be in main memory, so a program can be larger than main memory.
(C) True. A process needs only part of its pages in memory, so more processes fit in memory at once. This raises the degree of multiprogramming.
(D) False. On a context switch the OS must also switch to the new process's page table, and the cached translations in the TLB may have to be flushed, so the new process starts with TLB misses. Virtual memory adds to the context switching cost; it does not reduce it.
Answer: (D)
Which of the following requires a device driver ?
Answer: (D)
A device driver is the OS software that talks to an I/O device and its controller. It turns OS requests (read block, write block) into commands for that particular device.
- Register: inside the CPU, used directly by instructions. No driver.
- Cache: managed by hardware and invisible to software. No driver.
- Main memory: the CPU reads and writes it with ordinary load and store instructions through the memory controller. No driver.
- Disk: an I/O device with its own controller. The OS must use a disk driver to send commands and move data, and each type of disk needs its own driver.
Answer: (D)
- Register: inside the CPU, used directly by instructions. No driver.
- Cache: managed by hardware and invisible to software. No driver.
- Main memory: the CPU reads and writes it with ordinary load and store instructions through the memory controller. No driver.
- Disk: an I/O device with its own controller. The OS must use a disk driver to send commands and move data, and each type of disk needs its own driver.
Answer: (D)
Consider a schema R(A,B,C,D) and functional dependencies AB and CD. Then the decomposition of R into R1(AB) and R2(CD) is :
Answer: (C)
Lossless join: R1(AB) and R2(CD) have no common attribute, so is a Cartesian product. It gives extra tuples that were not in R, so the join is lossy.
Dependency preserving: has both attributes in R1, and has both attributes in R2. Both dependencies are kept in the decomposed relations, so it is dependency preserving.
Answer: (C)
Dependency preserving: has both attributes in R1, and has both attributes in R2. Both dependencies are kept in the decomposed relations, so it is dependency preserving.
Answer: (C)