GATE 2019
65 questions
MCQ 41 · NAT 241-mark 30 · 2-mark 35
Questions 51–55 of 65
Consider the following four processes with arrival times (in milliseconds) and their length of CPU burst (in milliseconds) as shown below:
These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 1 millisecond, then the value of Z is __________.
These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 1 millisecond, then the value of Z is __________.
Answer: 2
Average waiting time is 1 ms for 4 processes, so the total waiting time is 4 ms. Waiting time = completion time arrival time burst time.
SRTF up to t = 4:
- P1 runs from 0 to 1 (2 ms left).
- P2 arrives at 1 with burst 1, which is less than 2, so it preempts and runs from 1 to 2. P2 waits 0.
- P1 runs from 2 to 4. P3 arrives at 3, but P1 has 1 ms left, so there is no preemption. P1 completes at 4 and waits .
At t = 4, only P3 (3 ms) and P4 (Z ms) are left. Together they must account for ms of waiting.
- If : P4 runs first (waits 0), and P3 runs after it, completing at , so it waits . Total waiting . Setting gives , which is less than 3, so it is consistent.
- If : one of them runs 4 to 4+(its burst) and the other waits for it. If P3 goes first, P3 waits 1 and P4 waits 3; if P4 goes first (Z = 3), P4 waits 0 and P3 waits 4. Either way the total is 5, not 4. So no such Z works.
Check with Z = 2: P4 runs from 4 to 6 (wait 0), P3 runs from 6 to 9 (wait ). Total ms.
Answer: 2
SRTF up to t = 4:
- P1 runs from 0 to 1 (2 ms left).
- P2 arrives at 1 with burst 1, which is less than 2, so it preempts and runs from 1 to 2. P2 waits 0.
- P1 runs from 2 to 4. P3 arrives at 3, but P1 has 1 ms left, so there is no preemption. P1 completes at 4 and waits .
At t = 4, only P3 (3 ms) and P4 (Z ms) are left. Together they must account for ms of waiting.
- If : P4 runs first (waits 0), and P3 runs after it, completing at , so it waits . Total waiting . Setting gives , which is less than 3, so it is consistent.
- If : one of them runs 4 to 4+(its burst) and the other waits for it. If P3 goes first, P3 waits 1 and P4 waits 3; if P4 goes first (Z = 3), P4 waits 0 and P3 waits 4. Either way the total is 5, not 4. So no such Z works.
Check with Z = 2: P4 runs from 4 to 6 (wait 0), P3 runs from 6 to 9 (wait ). Total ms.
Answer: 2
The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointer The disk block size is 4 kB and the disk block addresses 32-bits long. The maximum possible file size is (rounded off to 1 decimal place) __________ GB.
Answer: 4 to 4.1
Number of pointers in one block = 4 KB / 4 B = 1024.
- Direct pointers: 12 4 KB = 48 KB
- Single indirect pointer: 1024 4 KB = 4 MB
- Double indirect pointer: 4 KB = 4 GB
Adding all three, total 4 GB + 4 MB + 48 KB 4.0 GB
Answer: 4.0
- Direct pointers: 12 4 KB = 48 KB
- Single indirect pointer: 1024 4 KB = 4 MB
- Double indirect pointer: 4 KB = 4 GB
Adding all three, total 4 GB + 4 MB + 48 KB 4.0 GB
Answer: 4.0
Consider the augmented grammar given below:
Let . The number of items in the set is __________.
Let . The number of items in the set is __________.
Answer: 5
In , the item moves on to . Closure (dot before L, then before S):
1.
2.
3.
4.
5.
Answer: 5
1.
2.
3.
4.
5.
Answer: 5
Consider the following matrix:
The absolute value of the product of Eigenvalues of R is _________ .
The absolute value of the product of Eigenvalues of R is _________ .
Answer: 12
The product of all eigenvalues of a matrix equals its determinant, so the product is .
Do these row operations: (each uses the original rows):
Do :
Do :
These operations do not change the determinant. The matrix is now upper triangular, so the determinant is the product of the diagonal elements: .
The absolute value of the product of the eigenvalues is 12.
Answer: 12
Do these row operations: (each uses the original rows):
Do :
Do :
These operations do not change the determinant. The matrix is now upper triangular, so the determinant is the product of the diagonal elements: .
The absolute value of the product of the eigenvalues is 12.
Answer: 12
A certain processor deploys a single-level cache. The cache block size is 8 words and the word size is 4 bytes. The memory system uses a 60-MHz clock. To service a cache-miss, the memory controller first takes 1 cycle to accept the starting address of the block, it then takes 3 cycles to fetch all the eight words of the block, and finally transmits the words of the requested block at the rate of 1 word per cycle. The maximum bandwidth for the memory system when the program running on the processor issues a series of read operations is _________ bytes/sec.
Answer: 160
A single cache miss fetches one block. The block has 8 words, and each word is 4 bytes: 8 4 = 32 bytes.
Cycles needed for one block = 1 (address) + 3 (fetch) + 8 (transfer at 1 word per cycle) = 12 cycles.
Time for one block = 12 / 60 MHz = 0.2 s.
Bandwidth = 32 bytes / 0.2 s = bytes/s
Answer: 160
Cycles needed for one block = 1 (address) + 3 (fetch) + 8 (transfer at 1 word per cycle) = 12 cycles.
Time for one block = 12 / 60 MHz = 0.2 s.
Bandwidth = 32 bytes / 0.2 s = bytes/s
Answer: 160