GATE 2015 (Session 2)
64 questions
MCQ 42 · NAT 221-mark 29 · 2-mark 35
Questions 16–20 of 64
An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is
Answer: (D)
Pick any 3 elements from the list and compare them with each other. This takes 3 comparisons. The element in the middle of the three is not the maximum and not the minimum of the whole list.
The number of comparisons stays fixed, so it is constant.
Answer:
The number of comparisons stays fixed, so it is constant.
Answer:
The minimum number of JK flip-flops required to construct a synchronous counter with the count sequence (0,0,1,1,2,2,3,3,0,0,...) is __________ .
Answer: 3
The count sequence 0, 0, 1, 1, 2, 2, 3, 3 takes 8 steps and then repeats. When two steps give the same output, they must still be different internal states. So the counter needs 8 states.
3 flip-flops
Answer: 3
3 flip-flops
Answer: 3
Assume that for a certain processor, a read request takes 50 nanoseconds on a cache miss and 5 nanoseconds on a cache hit. Suppose while running a program, it was observed that 80% of the processor's read requests result in a cache hit. The average read access time in nanoseconds is __________.
Answer: 14
Average read access time: 0.8 5 + 0.2 50 = 4 + 10 = 14 ns
Answer: 14
Answer: 14
A computer system implements a 40-bit virtual address, page size of 8 kilobytes, and a 128-entry translation look-aside buffer (TLB) organized into 32 sets each having four ways. Assume that the TLB tag does not store any process id. The minimum length of the TLB tag in bits is _________.
Answer: 22
Work through each part:
- Page offset: the page size is 8 KB = 13 bits. So the page number is 40 13 = 27 bits.
- There are 32 sets 5 index bits.
Tag length = 27 5 = 22 bits.
Answer: 22
- Page offset: the page size is 8 KB = 13 bits. So the page number is 40 13 = 27 bits.
- There are 32 sets 5 index bits.
Tag length = 27 5 = 22 bits.
Answer: 22
Consider the following statements.
I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?
I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable
Which of the above statements is/are true?
Answer: (D)
Let us check the statements one by one:
- I: Decidable languages are closed under complement True
- II: A (time-bounded) Turing machine decides every language in NP False
- III: The same reason holds True
Answer: Only I and III
- I: Decidable languages are closed under complement True
- II: A (time-bounded) Turing machine decides every language in NP False
- III: The same reason holds True
Answer: Only I and III