GATE 1991
Question 1 
For the digital in figure, the expression for the output f is ________
Out of syllabus. 
Question 2 
In interleaved memory organization, consecutive words are stored in consecutive memory modules in ________ interleaving, whereas consecutive words are stored within the module in ________ interleaving.
low order, high order 
→ Consecutive words in same memory module in high order interleaving as the higher order bits determine the module.
Question 3 
Consider the number given by the decimal expression:
16^{3} * 9 + 16^{2} * 7 + 16 * 5 + 3
The number of 1’s in the unsigned binary representation of the number is ________.
9 
(9753)_{16}
It's binary representation is,
1001011101010011
∴ The no. of 1's is 9.
Question 4 
Using the 8087 arithmetic coprocessor with the 8087 CPU requires that the 8087 CPU is operated ________.
Out of syllabus. 
Question 5 
When two 4bit binary number A = a_{3}a_{2}a_{1}a_{0} and B = b_{3}b_{2}b_{1}b_{0} are multiplied, the digit c_{1} of the product C is given by _________
c_{1} = b_{1}a_{0} ⊕ a_{1}b_{0} 
⇒ c_{1} = b_{1}a_{0} ⊕ a_{1}b_{0}
Question 6 
Consider the following PASCAL program segment:
if i mode 2 = 0 then while i > = 0 do begin i:=i div 2; if i mod 2 < > 0 do then i:=i – 1 else i:=i – 2 end
An appropriate loopinvariant for the whileloop is ______
PASCAL is out of syllabus. 
Question 7 
The minimum number of comparisons required to sort 5 elements is _____
7 
= ⌈log(n!)⌉
= ⌈log(5!)⌉
= ⌈log(120)⌉
= 7
Question 8 
The weighted external path length of the binary tree in figure is _____
144 
Question 9 
If the binary tree in figure is traversed in inorder, then the order in which the nodes will be visited is ______
4, 1, 6, 7, 3, 2, 5, 8 
(Left, Root, Right)
So, the order will be
4, 1, 6, 7, 3, 2, 5, 8
Question 10 
Consider the following recursive definition of fib:
fib (n) : = if n = 0 then 1 else if n = 1 than 1 else fib (n – 1) + fib (n – 2)
The number of times fib is called (including the first call) for an evaluation of fib (7) is ___________
41 
T(n) = T(n1) + T(n2) + 2
T(0) = T(1) = 0 (for fib(0) and fib(1), there are no extra recursive calls)
T(2) = 2
T(3) = 4
T(4) = 8
T(5) = 14
T(6) = 24
T(7) = 40
Counting the initial call, we get
40+1 = 41
Question 11 
The arithmetic expression : (a + b) * c  d / e * * f is to be evaluated on a twoaddress machine, where each operands, the number of registers required to evaluate this expression is ______. The number of memory access of operand is __________.
3, 4 
So, in total 3 registers are required and 6 memory operations in total to fetch all operands.
Question 12 
A given set of processes can be implemented by using only parbegin/parend statement, if the precedence graph of these processes is ________
properly nested. 
Question 13 
The number of integertriples (i.j.k) with 1 ≤ i.j.k ≤ 300 such that i + j + k is divisible by 3 is ________
Fill in the blanks. 
Question 14 
If the longest chain in a partial order is of length n then the partial order can be written as a ______ of n antichains.
disjoint 
Question 15 
The maximum number of possible edges in an undirected graph with a vertices and k components is ________.
(nk)(nk+1)/2 
To get maximum, take one vertex each for each component, except last component.
Now, k1 components have 1 vertex each and so on edges.
The last component has (n(k1)) vertices. So make the last component complete, i.e., it has ^{n(n1)}C_{2}
= (nk)(nk+1)/2
= maximum no. of edges
Question 16 
Match the pairs in the following questions by writing the corresponding letters only.
(A) IEEE 488 (P) specifies the interface for connecting a single device (B) IEEE 796 (Q) specifies the bus standard for connecting a computer to other devices including CPU’s (C) IEEE 696 (R) specifies the standard for an instrumentation bus (D) RS232C (S) specifies the bus standard for the “backplane” bus called multibus.
Out of syllabus. 
Question 17 
Match the pairs in the following questions by writing the corresponding letters only. For the 8086 microprocessor:
(A) RQ/GT (P) Used by processor for holding the bus for consecutive instruction cycles. (B) LOCK (Q) Used for extending the memory or I/O cycle times (C) HOLD (R) Used for getting hold of processor bus in minimum bus mode (D) READY (S) Used for requesting processor bus in minimum bus mode.
Out of syllabus. 
Question 18 
Match the pairs in the following questions by writing the corresponding letters only.
(A) Buddy system (P) Runtime type specification (B) Interpretation (Q) Segmentation (C) Pointer type (R) Memory allocation (D) Virtual memory (S) Garbage collection
AR, BP, CS, DQ 
BP
CS
DQ
Buddy system: The buddy system is a technique to allocate the memory by dividing the memory into partitions to try to satisfy a memory request as suitably as possible.
Interpretation: Runtime.
Pointer type: Garbage collector dereference the dangling pointer.
Virtual memory: Segmentation.
Question 19 
Match the pairs in the following questions by writing the corresponding letters only.
(A) The number distinct binary trees with n nodes (P) n!/2 (B) The number of binary strings of length of 2n (Q) (3n/n) with an equal number of 0’s and 1’s (C) The number of even permutations of n objects (R) (2n/n) (D) The number of binary strings of length 6m which (S) 1/n+1(2n/n) are palindromes with 2n 0’s.
AS, BR, CP, DQ 
Question 20 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: The advantages of CMOS technology over a MOS is:
lower power dissipation  
greater speed  
smaller chip size  
fewer masks for fabrication  
none of the above 
Question 21 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: Advantage of synchronous sequential circuits over asynchronous ones is:
faster operation  
ease of avoiding problems due to hazards  
lower hardware requirement  
better noise immunity
 
none of the above

Question 22 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: The total size of address space is a virtual memory systems is limited by
the length of MAR  
the available secondary storage  
the available main memory  
all of the above  
none of the above  
Both A and B 
MAR can hold the address that is generated from CPU and limits the total virtual memory address space.
Question 23 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: The TRAP interrupt mechanism of the 8085 microprocessor:
executes an instruction supplied by an external device through the INTA signal  
executes an instruction from memory location 20H  
executes a NOP  
none of the above 
Question 24 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: The ALE line of an 8085 microprocessor is used to:
latch the output of an I/O instruction into an external latch  
deactivate the chipselect signal from memory devices  
latch the 8 bits of address lines AD7AD0 into an external latch  
find the interrupt enable status of the TRAP interrupt  
None of the above 
Question 25 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: Kruskal’s algorithm for finding a minimum spanning tree of a weighted graph G with vertices and m edges has the time complexity of:
O(n^{2})  
O(mn)  
O(m+n)  
O(m log n)  
O(m^{2}  
B, D and E 
→ Where m is no. of edges and n is number of vertices then n = O(m^{2})
→ O(m logn) < O(mn)
Question 26 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: The following sequence of operations is performed on a stack:
PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP, PUSH (20), POPThe sequence of values popped out is:
20, 10, 20, 10, 20  
20, 20, 10, 10, 20  
10, 20, 20, 10, 20  
20, 20, 10, 20, 10 
→ PUSH(10), PUSH(10), PUSH(20), POP = 20 (ii)
→ PUSH(10), PUSH(10), POP = 10 (iii)
→ PUSH(10), POP = 10 (iv)
→ PUSH(20)
→ PUSH(20), POP = 20 (v)
⇒ 20, 20, 10, 10, 20
Question 27 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: Consider the following Pascal function:
function X (M:integer) : integer; var i:integer; begin i = 0; while i*i < M do i; =i+1 X;=i endThe function call X(N), if N is positive, will return
(√N)  
(√N)+1  
[√N]  
[√N]+1  
None of the above 
Question 28 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: A “link editor” is a program that:
matches the parameters of the macrodefinition with locations of the parameters of the macro call  
matches external names of one program with their location in other programs  
matches the parameters of subroutine definition with the location of parameters of subroutine call  
acts as link between text editor and the user  
acts as a link between compiler and user program 
1) external symbol resolution
2) relocation
Question 29 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: Indicate all the true statements from the following:
Recursive descent parsing cannot be used for grammar with left recursion.  
The intermediate form the representing expressions which is best suited for code optimization is the post fix form.  
A programming language not supporting either recursion or pointer type does not need the support of dynamic memory allocation.  
Although C does not support call by name parameter passing, the effect can be correctly simulated in C.
 
No feature of Pascal violates strong typing in Pascal.  
A and D 
(B) False.
(C) It is false. The language can have dynamic data types which required dynamically growing memory when data type size increases.
(D) Is true and using macro we can do this.
(E) Out of syllabus now.
Question 30 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: Indicate all the false statements from the statements given below:
The amount of virtual memory available is limited by the availability of secondary storage.  
Any implementation of a critical section requires the use of an indivisible machineinstruction, such as testandset.  
The LRU page replacement policy may cause hashing for some type of programs.  
The best fit techniques for memory allocation ensures the memory will never be fragmented.  
B and D 
(B) Is false, because one of the solution is Peterson's solution which is purely software based solution without use of hardware.
(C) Is true.
(D) False, memory can get fragmented with best fit technique.
Question 31 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: If F_{1}, F_{2} and F_{3} are propositional formulae such that F_{1} ∧ F_{2} → F_{3} and F_{1} ∧ F_{1} → ~F_{2} are both tautologies, then which of the following is true:
Both F_{1} and F_{2} are tautologies  
The conjunction F_{1} ∧ F_{2} is not satisfiable  
Neither is tautologous  
Neither is satisfiable  
None of the above 
So, in option (B) it is saying that F< sub>1 ∧ F_{2} is not satisfiable means F_{1} ∧ F_{2} is always false.
And False → anything is always true.
Question 32 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: Let r = 1(1+0)*, s = 11*0 and t = 1*0 be three regular expressions. Which one of the following is true?
L(s) ⊆ L(r) and L(s) ⊆ L(t)  
L(r) ⊆ L(s) and L(s) ⊆ L(t)  
L(s) ⊆ L(t) and L(s) ⊆ L(r)  
L(t) ⊆ L(s) and L(s) ⊆ L(r)  
None of the above  
A and C 
L(s) ⊆ L(t), because 't' generates all the strings which 's' generates but 't' also generates '0' which 's' do not generates.
Question 33 
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: Which one of the following is the strongest correct statement about a finite language over some finite alphabet ∑?
It could be undecidable  
It is Turingmachine recognizable  
It is a contextsensitive language  
It is a regular language  
None of the above  
B, C and D 
And, regular language ⊂ contextfree ⊂ contextsensitive ⊂ Turing recognizable, would imply that regular language is the strongest answer.
Question 34 
Give short answers to the following questions:
(i) Convert the following Pascal statement to a single assignment statement:
if x > 5 they y:=true else y:=false;(ii) Convert the Pascal statement repeat S until B; into an equivalent Pascal statement that uses the while construct.
(iii) Obtain the optimal binary search tree with equal probabilities for the identifier set (a_{1}, a_{2}, a_{3}) = (if, stop, while)
(iv) If a finite axiom system A for a theory is complete and consistent, then is every subsystem of A complete and consistent? Explain briefly.
Theory Explanation. 
Question 35 
(a) Analyse the circuit in figure and complete the following table:
(b) Find the minimum sum of products form of the logic function.
f(A,B,C,D) = ∑m(0,2,8,10,15) + ∑d(3,11,12,14)Where m and d denote the minterms and don’t cares respectively.
(c) Find the maximum clock frequency at which the counter in figure, can be operated. Assume that the propagation delay through each flipflop and AND gate is 10 ns. Also assume that the setup time for the JK inputs of the flipflops is negligible.
Theory Explanation. 
Question 36 
(a) Using D flipflop and gates, design a parallelin/serialout shift register that shifts data from left to right with the following input lines:
 (i) Clock CLK
(ii) Three parallel data inputs A, B, C
(iii) Serial input S
(iv) Control input .
(b) Design a 1024 bit serialin/serialout unidirectional shift register using a 1K × 1 bit RAM with data input D_{in}, data output D_{out} and control input . You may assume that availability of standard SSI and MSI components such as gates, registers and counters.
Theory Explanation. 
Question 37 
It is required to design a hardwired controller to handle the fetch cycle of a single address of an indexed instruction should be derived in the fetch cycle itself. Assume that the lower order 8 bits of an instruction constitute the operand field.
(a) Give the register transfer sequence for realizing the above instruction fetch cycle.
(b) Draw the logic schematic of the hardwired controller including the date path.
Theory Explanation. 
Question 38 
(a) Consider an 8085 based system operating with the following specification:
Crystal frequency : 6 MHz ROM map : 0000 through 07FF RAM map : 1000 through 17 FF: ROM requires one wait state. RAM requires no wait state.
Determine the instruction cycle time for each of the following instructions:
(i) ORI A, 22 (ii) DCR M
Assume the following initial conditions of the CPU registers (in hex) for each of the instructions:
A = 55, B = AA, C = F7, D = 10, H = 10, L = FF, PC = 0200, SP = 17FO.
(b) Developing an output port interface (draw a block schematic) for an 8085 based system with a demultiplexed address bus which incorporates a handshake protocol as per the timing diagram given in figure. The interface should include a status input port at I/O address 40H which reads the INTERRUPT and BUFFFULL signals through the most significant bit and the least significant bit, respectively. The output data port is at the same I/O address 40H and is activated by a write operation. Assume the availability of SSI and MSI level components only.
Write a short program segment which performs a 200 H byte programmed I/O data transfer to the device from memory address 3400 H,
Theory Explanation. 
Question 39 
(a) Consider the following pseudocode
(all data items are of type integer):
Procedure P (a, b, c); a:=2; c:=a+b; end {P} begin x:=1 y:=5; z:=100; P(x,x*y,z); Write (‘x=’,x,z=’,z) end:Determine its output, if the parameters are passed to the procedure P by (i) value, (ii) reference and (iii) name.
(b) For the following pseudocode, indicate the output, if
(i) static scope rules and (ii) dynamic scope rules are used
Var, a, b : integer; Procedure P; a:=5; b:=10 end {P}; procedure Q; var a, b : integer; P; end {Q}; begin a:=1; b:=2; Q; Write (‘a =’, a, ‘b=’,b) end.
Theory Explanation. 
Question 40 
Consider the following grammar for arithmetic expression using binary operators – and/which are not associative:
E → E−TT T → T/FF F → (E)id(E is the start symbol)
(a) Is this grammar unambiguous? If so, what is the relative precedence between – and/if not, give an unambiguous grammar that gives/precedence over 
(b) Does the grammar allow expressions with redundant parentheses as in (id/id) or in id(id/id)? If so, convert the grammar into one which does not generate expressions with redundant parentheses. Do this with minimum number of changes to the given production rules and adding at most one more production rule.
Theory Explanation. 
Question 41 
Consider the following scheme for implementing a critical section in a situation with three processes and P_{j} and P_{k}.
P_{i}; repeat flag [i]:=true; while flag [j] or flag [k] do case turn of j : if flag [j] then begin flag [i]:=false; while turn ≠ i do skip; flag [i] : true end; k : if flag [k] then begin flag [i]:=false, while turn ≠ i do skip; flag [i]:=true end end critical section if turn = i then turn:=j; flag [i]:=false noncritical section until false;
(a) Does the scheme ensure mutual exclusion in the critical section? Briefly explain.
(b) Is there a situation in which a waiting process can never enter the critical
section? If so, explain and suggest modifications to the code to solve this problem.
Theory Explanation. 
Question 42 
Suppose, a database consists of the following relations:
SUPPLIER (SCODE, SNAME, CITY) PART (PCODE, PNAME, PDESC, CITY) PROJECTS (PRCODE, PRNAME, CITY) SPRR (SCODE, PCODE, PRCODE, QJY)
(a) Write SQL programs corresponding to the following queries:
(i) Print PCODE value for parts supplied to any project in DELHI by a supplier in DELHI.
(ii) Print all triples (CITY, PCODE, CITY), such that a supplier in the first city supplies the specified part to a project in the second city, but do not print triples in which the two CITY values are the same.
(b) Write algebraic solutions to the following:
(i) Get SCODE values for suppliers who supply to both projects PR1 and PR2.
(ii) Get PRCODE values for projects supplied by at least one supplier not in the same city.
Theory Explanation. 
Question 43 
Consider the binary tree in Figure:
(a) What structure is represented by the binary tree?
(b) Give the different steps for deleting the node with key 5 so that the structure is preserved.
(c) Outline a procedure in pseudocode to delete an arbitrary node from such a binary tree with n nodes that preserves the structure. What is the worstcase timecomplexity of your procedure?
Theory Explanation. 
Question 44 
(a) Show that the product of the least common multiple and the greatest common divisor of two positive integers a and b is a*b.
(b) Consider the following first order formula:
(Ax)(Ey)R(x,y)∧(Ax)(Ay)(R(x,y) → ~R(y,x)) ∧(Ax)(Ay)(Az)(R(x,y)∧R(y,z) → R(x,z)) ∧(Ax) ~R(x,x)(Auniversal quantifier and Eexistential quantifier)
Does it have finite models?
Is it satisfiable? Is so, give a countable model for it.
Theory Explanation. 
Question 45 
(a) Find the number of binary strings w of length 2n with an equal number os 1’s and 0’s, and the property that every prefix and w has atleast as many 0’s as 1’s.
(b) Show that all vertices in an undirected finite graph cannot have distinct degrees, if the graph has at least two vertices.
Theory Explanation. 
Question 46 
(a) Show that Turing machines, which have a read only input tape and constant size work tape, recognize precisely the class or regular languages.
(b) Let L be the language of all binary strings in which the third symbol from the right is a_{1}. Give a nondeterministic finite automaton that recognizes L. How many states does the minimized equivalent deterministic finite automaton have? Justify your answer briefly?
Theory Explanation. 