GATE 1995
Question 1 |
A single instruction to clear the lower four bits of the accumulator in 8085 assembly language?
XRI OFH | |
ANI FOH | |
XRI FOH | |
ANI OFH |
→ The XOR's don't reliably clear random bits and ANI OF clears the upper nibble, not the lower nibble.
Question 2 |
Which of the following statements is true?
ROM is a Read/Write memory | |
PC points to the last instruction that was executed | |
Stack works on the principle of LIFO | |
All instructions affect the flags |
Question 3 |
In a vectored interrupt
the branch address is assigned to a fixed location in memory | |
the interrupt source supplies the branch information to the processor through an interrupt vector | |
the branch address is obtained from a register in the processor | |
none of the above |
Question 4 |
In the following Pascal program segment, what is the value of X after the execution of the program segment?
X:=-10; Y:=20;
If X > Y then if X < 0 then X:=abs(X) else X:=2*X;
10 | |
-20 | |
-10 | |
None |
X = -10
Question 5 |
Merge sort uses
Divide and conquer strategy | |
Backtracking approach | |
Heuristic search | |
Greedy approach |
Question 6 |
The principle of locality justifies the use of
interrupts | |
DMA | |
Polling | |
Cache Memory |
→ The things which are used more frequently those are stored in locality of reference.
→ For this purpose we use the cache memory.
Question 7 |
In a paged segmented scheme of memory management, the segment table itself must have a page table because
the segment table is often too large to fit in one page | |
each segment is spread over a number of pages | |
segment tables point to page table and not to the physical locations of the segment | |
the processor’s description base register points to a page table | |
Both A and B |
Segment paging is different from paged segmentation.
Question 8 |
Which of the following page replacement algorithms suffers from Belady’s anamoly?
Optimal replacement | |
LRU | |
FIFO | |
Both (A) and (C) |
Question 9 |
In some programming languages, an identifier is permitted to be a letter following by any number of letters or digits. If L and D denote the sets of letters and digits respectively, which of the following expressions defines an identifier?
(L ∪ D)+ | |
L(L ∪ D)* | |
(L⋅D)* | |
L⋅(L⋅D)* |
L(L ∪ D)*
Question 10 |
Consider a grammar with the following productions
S → a∝b|b∝c| aB S → ∝S|b S → ∝b b|ab S ∝ → bd b|b
The above grammar is:
Context free | |
Regular | |
Context sensitive | |
LR(k) |
Because LHS must be single non-terminal symbol.
S ∝→ b [violates CSG]
→ Length of RHS production must be atleast same as that of LHS.
Extra information is added to the state by redefining iteams to include a terminal symbol as second component in this type of grammar.
Ex: [A → αβa]
A → αβ is a production, a is a terminal (or) right end marker $, such an object is called LR(k).
So, answer is (D) i.e., LR(k).
Question 11 |
What are x and y in the following macro definition?
macro Add x,y Load y Mul x Store y end macro
Variables | |
Identifiers | |
Actual parameters | |
Formal parameters |
Question 12 |
What is the distance of the following code 000000, 010101, 000111, 011001, 111111?
2 | |
3 | |
4 | |
1 |
010101 ⊕ 011001 = 001100
Question 13 |
Which of the following strings can definitely be said to be tokens without looking at the next input character while compiling a Pascal program?
I. begin II. program III. <>
I | |
II | |
III | |
All of the above |
Question 14 |
A linker is given object modules for a set of programs that were compiled separately. What information need to be included in an object module?
Object code | |
Relocation bits | |
Names and locations of all external symbols defined in the object module
| |
Absolute addresses of internal symbols |
To link to external symbols it must know the location of external symbols.
Question 15 |
Which scheduling policy is most suitable for a time shared operating system?
Shortest Job First | |
Round Robin | |
First Come First Serve | |
Elevator |
Question 16 |
For merging two sorted lists of sizes m and n into a sorted list of size m+n, we required comparisons of
O(m) | |
O(n) | |
O(m+n) | |
O(logm+logn) |
In worst case, no. of comparisons is m+n-1.
Then we require O(m+n) comparisons to merging two sorted lists.
Question 17 |
A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is:
log2 n | |
n - 1 | |
n | |
2n |
The no. of subtrees of a node is called the degree of the node. In a binary tree, all nodes have degree 0, 1 and 2.
The degree of a tree is the maximum degree of a node in the tree. A binary tree is of degree 2.
The number of nodes of degree 2 in T is "n - 1".
Question 18 |
The probability that a number selected at random between 100 and 999 (both inclusive) will not contain the digit 7 is:
16/25 | |
(9/10)3 | |
27/75 | |
18/25 |