GATE 2017 (Session 1)
64 questions
MCQ 44 · NAT 201-mark 30 · 2-mark 34
Questions 31–35 of 64
Consider the Karnaugh map given below, where x represents "don't care" and blank represents 0.
Assume for all inputs (a, b, c, d) the respective complements are also available. The above logic is implemented 2-input NOR gates only. The minimum number of gates required is ____________.
Assume for all inputs (a, b, c, d) the respective complements are also available. The above logic is implemented 2-input NOR gates only. The minimum number of gates required is ____________.
Answer: 1
The 1s, together with suitable don't-cares, make one single group. This group covers every cell where c = 1 and a = 0. So the function is .
Write it with NOR: This needs only one 2-input NOR gate, because the complements are already available.
Answer: 1
Write it with NOR: This needs only one 2-input NOR gate, because the complements are already available.
Answer: 1
Consider the language L given by the regular expression (a+b )* b (a+b ) over the alphabet {a, b}. The smallest number of states needed in a deterministic finite-state automation (DFA) accepting L is ___________.
Answer: 4
L has all strings whose second-last symbol is b. So the DFA has to remember the last two symbols. Use the states aa, ab, ba, bb (the last two symbols read). On reading symbol , state goes to state . The start state, before two symbols are read, acts as aa, because a missing symbol is not a b. The accepting states are ba and bb.
All 4 are distinguishable. The empty string separates {ba, bb} (accepted) from {aa, ab} (rejected). The string "a" then separates the rest: ab goes to ba (accepted) but aa goes to aa (rejected), and bb goes to ba (accepted) but ba goes to aa (rejected).
So the minimal DFA has 4 states.
Answer: 4
All 4 are distinguishable. The empty string separates {ba, bb} (accepted) from {aa, ab} (rejected). The string "a" then separates the rest: ab goes to ba (accepted) but aa goes to aa (rejected), and bb goes to ba (accepted) but ba goes to aa (rejected).
So the minimal DFA has 4 states.
Answer: 4
Consider a database that has the relation schema EMP (EmpId, EmpName, and DeptName). An instance of the schema EMP and a SQL query on it are given below.
| EMP | ||
| EmpId | EmpName | DeptName |
| 1 | XYA | AA |
| 2 | XYB | AA |
| 3 | XYC | AA |
| 4 | XYD | AA |
| 5 | XYE | AB |
| 6 | XYF | AB |
| 7 | XYG | AB |
| 8 | XYH | AC |
| 9 | XYI | AC |
| 10 | XYJ | AC |
| 11 | XYK | AD |
| 12 | XYL | AD |
| 13 | XYM | AE |
SELECT AVG(EC.Num)
FROM EC
WHERE (DeptName, Num) IN
(SELECT DeptName, COUNT(EmpId) AS
EC(DeptName, Num)
FROM EMP
GROUP BY DeptName) The output of executing the SQL query is _____.Answer: 2.6
The inner query groups the rows by department and counts the employees in each. The counts are AA 4, AB 3, AC 3, AD 2 and AE 1. Each (DeptName, Num) pair comes from this same result, so all five rows pass the condition.
The average is (4 + 3 + 3 + 2 + 1) / 5 = 13 / 5 = 2.6
Answer: 2.6
The average is (4 + 3 + 3 + 2 + 1) / 5 = 13 / 5 = 2.6
Answer: 2.6
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU burst (in milliseconds) as given below:
If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes., then the average waiting time across all processes is ________ milliseconds.
If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes., then the average waiting time across all processes is ________ milliseconds.
Answer: 3
SRTF schedule: P1 runs 0-3 (4 left); P2 (3) preempts and runs 3-6; at 6: P1 4, P3 5, P4 2 P4 runs 6-8; P1 runs 8-12; P3 runs 12-17.
Waiting times: P1 = 12 0 7 = 5, P2 = 0, P3 = 17 5 5 = 7, P4 = 0 mean = 12 / 4 = 3
Answer: 3
Waiting times: P1 = 12 0 7 = 5, P2 = 0, P3 = 17 5 5 = 7, P4 = 0 mean = 12 / 4 = 3
Answer: 3
Consider a two-level cache hierarchy with L1 and L2 caches. An application incurs 1.4 memory accesses per instruction on average. For this application, the miss rate of L1 cache 0.1, the L2 cache experiences, on average, 7 misses per 1000 instructions. The miss rate of L2 expressed correct to two decimal places is ___________.
Answer: 0.05
Take 1000 instructions. The memory accesses are 1400. The L1 misses are 0.1 1400 = 140. All 140 of these go to L2, and L2 misses 7 of them.
L2 miss rate = 7 / 140 = 0.05
Answer: 0.05
L2 miss rate = 7 / 140 = 0.05
Answer: 0.05