Gate-1995

Question 1
A single instruction to clear the lower four bits of the accumulator in 8085 assebly language?
A
XRI OFH
B
ANI FOH
C
XRI FOH
D
ANI OFH
       TOC
Question 1 Explanation: 
Here, we use the AND as a accumulator with immediate. F leaves the high nibble whatever it is, 0 clears the lower nibble.
→ 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?
A
ROM is a Read/Write memory
B
PC points to the last instruction that was executed
C
Stack works on the principle of LIFO
D
All instructions affect the flags
       TOC
Question 2 Explanation: 
We know that stack works on the principle of LIFO.
Question 3
In a vectored interrupt
A
the branch address is assigned to a fixed location in memory
B
the interrupt source supplies the branch information to the processor through an interrupt vector
C
the branch address is obtained from a register in the processor
D
none of the above
       CN
Question 3 Explanation: 
A vectored interrupt is a processing technique in which the interrupting device directs the processor to the appropriate interrupt service routine vector.
Question 4
 
A
10
B
-20
C
-10
D
None
       CN
Question 4 Explanation: 
X is remains unchanged. As the if condition is becomes false.
X = -10
Question 5
Merge sort uses
A
Divide and conquer strategy
B
Backtracking approach
C
Heuristic search
D
Heuristic search
       CN
Question 5 Explanation: 
Merge sort uses the divide and conquer strategy.
Question 6
The principle of locality justifies the use of
A
interrupts
B
DMA
C
Polling
D
Cache Memory
       Algorithms
Question 6 Explanation: 
The locality of reference is also known as principle of locality.
→ 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
A
the segment table is often too large to fit in one page
B
each segment is spread over a number of pages
C
segment tables point to page table and not to the physical locations of the segment
D
the processor’s description base register points to a page table
E
Both A and B
       Algorithms
Question 7 Explanation: 
The segment table is often too large to fit in one page. This is true and the segment table can be divided into pages. Thus page table for each segment table, pages are created.
Segment paging is different from paged segmentation.
Question 8
Which of the following page replacement algorithms suffers from Belady’s anamoly?
A
Optimal replacement
B
LRU
C
FIFO
D
Both (A) and (C)
       Algorithms
Question 8 Explanation: 
FIFO is suffers from Belady's Anamoly.
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?
A
(L ∪ D)+
B
L(L ∪ D)*
C
(L⋅D)*
D
L⋅(L⋅D)*
       Algorithms
Question 9 Explanation: 
Which is to be letter followed by any number of letters (or) digits
L(L⋅D)*
Question 10
     
A
Context free
B
Regular
C
Context sensitive
D
LR(k)
       Algorithms
Question 10 Explanation: 
S ∝→ [violates context free]
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
 
A
Variables
B
Identifiers
C
Actual parameters
D
Formal parameters
       Algorithms
Question 11 Explanation: 
Formal arguments (or) formal parameters is a special kind of variables used in subroutime to refer to one of pieces of data provided as input to the subroutine.
Question 12
What is the distance of the following code 000000, 010101, 000111, 011001, 111111?
A
2
B
3
C
4
D
1
       Algorithms
Question 12 Explanation: 
Distance = Minimum hamming distance = 2
010101 ⊕ 011001 = 001100
Question 13
 
A
I
B
II
C
III
D
All of the above
       CO
Question 13 Explanation: 
Note: Out of syllabus.
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?
A
Object code
B
Relocation bits
C
Names and locations of all external symbols defined in the object module
D
Absolute addresses of internal symbols
       CO
Question 14 Explanation: 
In object module it includes names and locations of all external symbols defined in the object module.
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?
A
Shortest Job First
B
Round Robin
C
First Come First Serve
D
Elevator
       CO
Question 15 Explanation: 
In Round robin, we use the time quentum based on this execution can be done. Then it is said to be time shared operating system.
Question 16
For merging two sorted lists of sizes m and n into a sorted list of size m+n, we required comparisons of
A
O(m)
B
O(n)
C
O(m+n)
D
O(logm+logn)
       CO
Question 16 Explanation: 
In best case, no. of comparisons is Min(m,n).
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:
A
log2 n
B
n - 1
C
n
D
2n
       CO
Question 17 Explanation: 
A binary tree is a tree data structure in which each node has atmost two child nodes.
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:
A
B
C
D
       CO
Question 18 Explanation: 
Question 19
Let R be a symmetric and transitive relation on a set A. Then
A
R is reflexive and hence an equivalence relation
B
R is reflexive and hence a partial order
C
R is reflexive and hence not an equivalence relation
D
None of the above
       DLD
Question 19 Explanation: 
If a relation is equivalence then it must be
i) Symmetric
ii) Reflexive
iii) Transitive
If a relation is said to be symmetric and transitive then we can't say the relation is reflexive and equivalence.
Question 20
The number of elements in he power set P (S) of the set S = {(φ), 1, (2, 3)} is:
A
2
B
4
C
8
D
None of the above
       DLD
Question 20 Explanation: 
S = {(φ), 1, (2, 3)}
P(S) = {φ, {{φ}}, {1}, {{2, 3}}, {{φ}, 1}, {1, {2, 3}}, {{φ}, 1, {2, 3}}}
In P(S) it contains 8 elements.
Question 21
In the interval [0, π] the equation x = cos x has
A
No solution
B
Exactly one solution
C
Exactly two solutions
D
An infinite number of solutions
       DLD
Question 21 Explanation: 

x & cos(x) are intersecting at only one point.
Question 22
 
A
a straight line
B
a parabola
C
a circle
D
an ellipse
       DLD
Question 22 Explanation: 
Note: Out of syllabus.
Question 23
The value of k for which 4x2 - 8xy + ky2 = 0 does not represent a pair of straight lines (both passing through the origin) is:
A
0
B
2
C
9
D
3
       DLD
Question 23 Explanation: 
Note: Out of syllabus.
Question 24
 
A
1
B
2
C
n
D
Depends on the value of a
       DS
Question 24 Explanation: 
Question 25
The minimum number of edges in a connected cyclic graph on n vertices is:
A
n - 1
B
n
C
n + 1
D
None of the above
       DS
Question 25 Explanation: 
In a normal graph number of edges required for n vertices is n-1, and in cyclic graph it is n.
In cyclic graph:
No. of edges = No. of vertices
⇒ n = n
Question 26
A sequence of two instructions that multiplies the contents of the DE register pair by 2 and stores the result in the HL register pair (in 8085 assembly language) is:
A
XCHG and DAD B
B
XTHL and DAD H
C
PCHL and DAD D
D
XCHG and DAD H
       DS
Question 26 Explanation: 
Note: Out of syllabus.
Question 27
The capacity of a memory unit is defined by the number of words multiplied by the number of bits/word. How many separate address and data lines are needed for a memory of 4K × 16?
A
10 address, 16 data lines
B
11 address, 8 data lines
C
12 address, 16 data lines
D
12 address, 12 data lines
       DS
Question 27 Explanation: 
ROM memory size = 2m × n
m = no. of address lines
n = no. of data lines
Given, 4K × 16 = 212 × 16
Address lines = 12
Data lines = 16
Question 28
 
A
Computes the LCM of two numbers
B
Divides the larger number by the smaller number
C
Computes the GCD of two numbers
D
None of the above
       EM
Question 28 Explanation: 
Let X=3 and Y=5
1st pass : X=3 and Y=2
2nd pass : X=1 and Y=2
3rd pass : X=1 and Y=1
Write(X), which writes 1. Which is nothing but GCD of 3 & 5.
Question 29
 
A
2
B
C
Run time error
D
None of the above
       EM
Question 29 Explanation: 
Since nothing is said in question. So we will assume by default call by value.
X in the procedure FIND is a local variable. No change will be reflected in global variable X.
Question 30
   
A
A = 1, B = 0, C = 0, D = 1
B
A = 1, B = 1, C = 0, D = 0
C
A = 1, B = 0, C = 1, D = 1
D
A = 1, B = 0, C = 0, D = 0
       EM
Question 30 Explanation: 
For verification, just put up the values and check for AND, OR operations and their outputs.
Question 31
 
A
{3,2,1),1
B
(2,1,3},0
C
{3,2,1),0
D
{1,2,3},5
       EM
Question 31 Explanation: 
Here, in option (B) and (C) they have given CPU idle time is 0 which is not possible as per schedule (B) and (C).
So, (B) and (C) will be eliminated.
Now in (A) and (D):
For r(A),

So, idle time is between 0 to 1 which in case of option (A).
For option(D),

We can see there is no idle time at all, but in option given idle time is 5, which is not matching with our chart. So option (D) is eliminated.
Therefore, the correct sequence is option (A).
Question 32
 
A
13
B
8
C
7
D
10
       OS
Question 32 Explanation: 
Page are fitted in frames, so first we need to determine the pages but given request are just the record request in decimal. We can assume that first page to address from 0000 to 0099 and page 2 contains records from 0100 to 0199 and so on (it is given in question that each page contains 100 records) and so on. So page request string is
01, 02, 04, 04, 05, 05, 05, 01, 02, 02, 02, 03, 03.
Clearly 7 page faults.
Question 33
If the cube roots of unity are 1, ω and ω2, then the roots of the following equation are (x - 1)3 + 8 = 0  
A
-1, 1 + 2ω, 1 + 2ω2
B
1, 1 - 2ω, 1 - 2ω2
C
-1, 1 - 2ω, 1 - 2ω2
D
-1, 1 + 2ω, -1 + 2ω2
       OS
Question 33 Explanation: 
Just put values of (C) in place of x. It will satisfy the equation.
Question 34
 
A
ac
B
bc
C
ab
D
cc
       OS
Question 34 Explanation: 
concat (a, head (tail (tail (acbc))))
concat (a, head (tail (cbc)))
concat (a, head (bc))
concat (a, b)
ab
Question 35
   
A
23131
B
11233
C
11231
D
33211
       CD
Question 35 Explanation: 

⇒ 23131
Note SR is bottom up parser.
Question 36

A
2800
B
2400
C
2000
D
1200
       CD
Question 36 Explanation: 
Note: Out of syllabus.
Question 37
 
A
8
B
9
C
10
D
12
       CD
Question 37 Explanation: 
Question 38
A unit vector perpendicular to both the vectors a = 2i - 2j + k and b = 1 + j - 2k is:
A
B
C
D
E
None of the above.
       TOC
Question 38 Explanation: 
Question 39
A bag contains 10 white balls and 15 black balls. Two balls are drawn in succession. The probability that one of them is black and the other is white is:
A
B
C
D
       TOC
Question 39 Explanation: 
Probability of first ball white and second one black is,

Probability of first ball black and second one white is,
Question 40
The iteration formula to find the square root of a positive real number b using the Newton Raphson method is
A
B
C
D
None of the above
       TOC
Question 40 Explanation: 
Note: Out of syllabus.
Question 41
In a virtual memory system the address space specified by the address lines of the CUP must be __________ than the physical memory size and _______ than the secondary storage size.
A
smaller, smaller
B
smaller, larger
C
larger, smaller
D
larger, larger
       DBMS
Question 41 Explanation: 
Primary memory < Virtual memory < Secondary memory.
Question 42
Let A be the set of all non-singular matrices over real number and let* be the matrix multiplication operation. Then
A
A is closed under* but < A, *> is not a semigroup
B
is a semigroup but not a monoid
C
is a monoid but not a group
D
is a group but not an abelian group
       DBMS
Question 42 Explanation: 
As the matrices are non-singular so their determinant ±0. Hence, the inverse matrix always exist. But for a group to be Abelian it should follow commutative property. As matrix multiplication is not commutative, is a group but not an abelian group.
Question 43
The solution of differential equation y'' + 3y' + 2y = 0 is of the form
A
B
C
D
       DBMS
Question 43 Explanation: 
Note: Out of syllabus.
Question 44
If the proposition ¬p ⇒ ν is true, then the truth value of the proposition ¬p ∨ (p ⇒ q), where ¬ is negation, ‘∨’ is inclusive or and ⇒ is implication, is  
A
true
B
multiple valued
C
false
D
cannot be determined
       Algorithms
Question 44 Explanation: 
From the axiom ¬p → q, we can conclude that p ∨ q.
So, either p or q must be True.
Now,
¬p ∨ (p → q)
= ¬p ∨ (¬p ∨ q)
= ¬p ∨ q
Since nothing c an be said about the truth values of p, it implies that ¬p ∨ q can also be True or False. Hence, the value cannot be determined.
Question 45
 
A
I only
B
I and II
C
II and III
D
II only
       Algorithms
Question 45 Explanation: 
(I) is the correct definition and the other two is wrong because the other two can have any no. of x and y. There is no such restriction over the number of both being equal.
Question 46
 
A
AB + CD + *F/D + E*
B
ABCD + *F/DE*++
C
A *B + CD/F *DE++
D
A + *BCD/F* DE++
E
None of the above
       Algorithms
Question 46 Explanation: 
The postfix expression will be,
A B C D + * F / + D E * +
Question 47
 
A
I and II
B
II and III
C
I and IV
D
I and III
       cn
Question 47 Explanation: 
Binary search using linked list is not efficient as it will not give O(log n), because we will not be able to find the mid in constant time. Fnding mid in linked list takes O(n) time.
Recursive program requires stack for storing the function state. Any recursive program can be rewritten as an iterative one. Advantage of recursion is "less programming effort", while it always lags behind ietrative one in terms of performance.
Question 48
   
A
01
B
10
C
101
D
110
       cn
Question 48 Explanation: 

If A is the start state, shortest sequence is 10 'or' 00 to reach C.
If B is the start state, shortest sequence is 0 to reach C.
If C is the start state, shortest sequence is 10 or 00 to reach C.
If D is the start state, shortest sequence is 0 to reach C.
∴ (B) is correct.
Question 49
Let Σ = {0,1}, L = Σ* and R = {0n1n such that n >0} then the languages L ∪ R and R are respectively
A
regular, regular
B
not regular, regular
C
regular, not regular
D
not regular, no regular
       cn
Question 49 Explanation: 
L∪R is nothing but L itself. Because R is subset of L and hence regular. R is deterministic context free but not regular as we require a stack to keep the count of 0's to make that of 1's.
Question 50

A computer system has a 4K word cache organized in block-set-associative manner with 4 blocks per set, 64 words per block. The number of its in the SET and WORD fields of the main memory address format is:

A
15, 40
B
6, 4
C
7, 2
D
4, 6
       cn
Question 50 Explanation: 
No. of sets = 4K/ (64×4) = 212/ 28 = 24
So we need 4 set bits.
And,
64 words per block means WORD bit is 6-bits.
So, answer is option (D).
There are 50 questions to complete.