GATE 2023
65 questions
MCQ 34 · MSQ 15 · NAT 161-mark 30 · 2-mark 35
Questions 21–25 of 65
The output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure.
Match the functional equivalence of this circuit to one of the following options.
Match the functional equivalence of this circuit to one of the following options.
Answer: (B)
Output Q is connected back to input 0.
- When S = 1, Q takes the value of input 1, which is the data input D.
- When S = 0, Q = Q, so the circuit holds its old value.
The circuit passes the data while S = 1 and keeps the value while S = 0. This is a level-triggered D latch, and S works as the enable. No clock edge is used, so it is not a flip-flop.
Answer: D Latch
- When S = 1, Q takes the value of input 1, which is the data input D.
- When S = 0, Q = Q, so the circuit holds its old value.
The circuit passes the data while S = 1 and keeps the value while S = 0. This is a level-triggered D latch, and S works as the enable. No clock edge is used, so it is not a flip-flop.
Answer: D Latch
Which one or more of the following need to be saved on a context switch from one thread (T1) of a process to another thread (T2) of the same process?
One or more options are correct.
Answer: (B), (C), (D)
Both threads belong to the same process, so they use the same address space. The page table base register stays the same. It does not need to be saved.
Every thread runs with its own context. This context is the stack pointer, the program counter and the general purpose registers all of these have to be saved.
Answer: Stack pointer, Program counter, General purpose registers
Every thread runs with its own context. This context is the stack pointer, the program counter and the general purpose registers all of these have to be saved.
Answer: Stack pointer, Program counter, General purpose registers
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?
One or more options are correct.
Answer: (C), (D)
See which events always take the system into the kernel:
- Function call: it runs fully in user mode so there is no mode switch.
- malloc: it is a library function. Most of the time it takes memory from the heap that already exists, and only sometimes does it make a system call so it is not guaranteed.
- Page fault: it is an exception that the OS handles so it is always kernel mode.
- System call: it is a trap into the kernel so it is always kernel mode.
Answer: Page Fault, System Call
- Function call: it runs fully in user mode so there is no mode switch.
- malloc: it is a library function. Most of the time it takes memory from the heap that already exists, and only sometimes does it make a system call so it is not guaranteed.
- Page fault: it is an exception that the OS handles so it is always kernel mode.
- System call: it is a trap into the kernel so it is always kernel mode.
Answer: Page Fault, System Call
Which of the following statements is/are CORRECT?
One or more options are correct.
Answer: (A), (C), (D)
Let us check each statement one by one:
- Regular languages are closed under intersection so this is TRUE.
- CFLs are not closed under intersection: so this is FALSE.
- Recursive languages: run both deciders and accept if both accept so this is TRUE.
- RE languages: run both recognizers and accept when both accept so this is TRUE.
Answer: Options 1, 3 and 4
- Regular languages are closed under intersection so this is TRUE.
- CFLs are not closed under intersection: so this is FALSE.
- Recursive languages: run both deciders and accept if both accept so this is TRUE.
- RE languages: run both recognizers and accept when both accept so this is TRUE.
Answer: Options 1, 3 and 4
Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet?
One or more options are correct.
Answer: (A), (C)
OSPF is a link-state protocol that works inside one autonomous system.
- (A) is INCORRECT. OSPF does not use Bellman-Ford. Bellman-Ford belongs to distance-vector protocols such as RIP.
- (B) is correct. Each router builds the full topology from link-state advertisements and runs Dijkstra's algorithm to find least-cost paths.
- (C) is INCORRECT. OSPF is an intra-domain (interior) protocol. BGP is the inter-domain protocol.
- (D) is correct. OSPF divides an AS into areas joined by a backbone area, which is hierarchical routing.
Answer: (A), (C)
- (A) is INCORRECT. OSPF does not use Bellman-Ford. Bellman-Ford belongs to distance-vector protocols such as RIP.
- (B) is correct. Each router builds the full topology from link-state advertisements and runs Dijkstra's algorithm to find least-cost paths.
- (C) is INCORRECT. OSPF is an intra-domain (interior) protocol. BGP is the inter-domain protocol.
- (D) is correct. OSPF divides an AS into areas joined by a backbone area, which is hierarchical routing.
Answer: (A), (C)