GATE 2020
64 questions
MCQ 41 · NAT 231-mark 29 · 2-mark 35
Questions 11–15 of 64
Consider the functions
I.
II.
III.
Which of the above functions is/are increasing everywhere in [0,1] ?
I.
II.
III.
Which of the above functions is/are increasing everywhere in [0,1] ?
Answer: (A)
Look at the derivative on [0, 1]:
- I: it is decreasing.
- II: equals at x = 0 it decreases near 0.
- III: it increases on the whole interval.
Answer: III only
- I: it is decreasing.
- II: equals at x = 0 it decreases near 0.
- III: it increases on the whole interval.
Answer: III only
For parameters a and b, both of which are , and . Then is
Answer: (A)
At every step, n is replaced by its a-th root: . This goes on until the value is b.
Every step costs 1, so .
Answer:
Every step costs 1, so .
Answer:
Consider the following statements.
I. Daisy chaining is used to assign priorities in attending interrupts.
II. When a device raises a vectored interrupt, the CPU does polling to identify the source of interrupt.
III. In polling,the CPU periodically checks the status bits to know if any device needs its attention.
IV. During DMA, both the CPU and DMA controller can be bus masters at the same time.
Which of the above statements is/are TRUE?
I. Daisy chaining is used to assign priorities in attending interrupts.
II. When a device raises a vectored interrupt, the CPU does polling to identify the source of interrupt.
III. In polling,the CPU periodically checks the status bits to know if any device needs its attention.
IV. During DMA, both the CPU and DMA controller can be bus masters at the same time.
Which of the above statements is/are TRUE?
Answer: (C)
Let us check every statement:
- I: In daisy chaining, the devices are joined in a series. The device closest to the CPU has the highest priority TRUE.
- II: A vectored interrupt gives the ISR address by itself, so the CPU does not need polling FALSE.
- III: This is exactly what polling means TRUE.
- IV: There is only one bus master at one time. The CPU leaves the bus during DMA FALSE.
Answer: I and III only
- I: In daisy chaining, the devices are joined in a series. The device closest to the CPU has the highest priority TRUE.
- II: A vectored interrupt gives the ISR address by itself, so the CPU does not need polling FALSE.
- III: This is exactly what polling means TRUE.
- IV: There is only one bus master at one time. The CPU leaves the bus during DMA FALSE.
Answer: I and III only
Consider the following data path diagram.
Consider an instruction: . The following steps are used to execute it over the given data path. Assume that PC is incremented appropriately. The subscripts r and w indicate read and write operations, respectively.
Which one of the following is the correct order of execution of the above steps?
Consider an instruction: . The following steps are used to execute it over the given data path. Assume that PC is incremented appropriately. The subscripts r and w indicate read and write operations, respectively.
Which one of the following is the correct order of execution of the above steps?
Answer: (C)
Fetch the instruction first, then execute it:
- 3: PC MAR, then read memory (this is the fetch)
- 5: MDR IR (the instruction is now in IR)
- 2: R1 TEMP1 (TEMP1 holds one input of the ALU)
- 1: R2 goes on the bus, and with TEMP1 ALU add TEMP2
- 4: TEMP2 R0
Answer: 3, 5, 2, 1, 4
- 3: PC MAR, then read memory (this is the fetch)
- 5: MDR IR (the instruction is now in IR)
- 2: R1 TEMP1 (TEMP1 holds one input of the ALU)
- 1: R2 goes on the bus, and with TEMP1 ALU add TEMP2
- 4: TEMP2 R0
Answer: 3, 5, 2, 1, 4
The preorder traversal of a binary search tree is 15,10,12,11,20,18,16,19. Which one of the following is the postorder traversal of the tree?
Answer: (B)
Construct the BST from the preorder, where the root comes first:
- The root is 15. The left subtree has {10, 12, 11}: 10 has right child 12 which has left child 11.
- The right subtree has {20, 18, 16, 19}: 20 has left child 18 which has children 16 and 19.
Postorder (left, right, root): 11, 12, 10, 16, 19, 18, 20, 15
Answer: 11, 12, 10, 16, 19, 18, 20, 15
- The root is 15. The left subtree has {10, 12, 11}: 10 has right child 12 which has left child 11.
- The right subtree has {20, 18, 16, 19}: 20 has left child 18 which has children 16 and 19.
Postorder (left, right, root): 11, 12, 10, 16, 19, 18, 20, 15
Answer: 11, 12, 10, 16, 19, 18, 20, 15