SlideShare a Scribd company logo
1 of 13
Download to read offline
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
SECTION - A
1. Fill in the blanks:
(i) For the digital in figure, the expression for the output f is _________
(ii) In interleaved memory organization, consecutive words are stored in
consecutive memory modules in ________ interleaving, whereas consecutive
words are stored within the module in ________ interleaving.
(iii) Consider the number given by the decimal expression:
3 2
16 * 9 16 * 7 16 * 5 3+ + +
The number of 1’s in the unsigned binary representation of the number is
________.
(iv) Using the 8087 arithmetic coprocessor with the 8087 CPU requires that the
8087 CPU is operated ________.
(v) When two 4-bit binary number 3 2 1 0 3 2 1 0andA a a a a B b b b b= = are multiplied,
the digit 1c of the product C is given by _________
(vi) 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 loop-invariant for the while-loop is ______
(vii)The minimum number of comparisons required to sort 5 elements is _____
a b
x
y
f
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
(viii) The weighted external path length of the binary tree in figure is _____
(ix) If the binary tree in figure is traversed in inorder, then the order in which the
nodes will be visited is ______
(x) 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 ___________
(xi) The arithmetic expression : ( ) * / * *a b c d e f+ − is to be evaluated on a two-
address machine, where each operands, the number of registers required to
evaluate this expression is ______. The number of memory access of
operand is __________.
(xii)A given set of processes can be implemented by using only
parbegin/parend statement, if the precedence graph of these processes is
________
(xiii) The number of integer-triples (i.j.k) with 1 ≤ i.j.k ≤ 300 such that i + j + k is
divisible by 3 is ________
(xiv) If the longest chain in a partial order is of length n then the partial order
can be written as a ______ of n antichains.
(xv)The maximum number of possible edges in an undirected graph with a
vertices and k components is ________.
15
9 10
7
5
42
1
4 6
7
3
5
2
8
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
2. Match the pairs in the following questions by writing the corresponding letters
only.
(i)
(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) RS232-C (S) specifies the bus standard for the “backplane” bus called multibus.
(ii) For the 8086 microprocessor:
(iii)
(A) Buddy system (P) Run-time type specification
(B) Interpretation (Q) Segmentation
(C) Pointer type (R) Memory allocation
(D) Virtual memory (S) Garbage collection
(iv)
(A) The number distinct binary trees with n nodes
(P)
!
2
n
(B) The number of binary strings of length of 2n with an equal number
of 0’s and 1’s (Q)
3n
n
 
 
 
(C) The number of even permutations of n objects
(R)
2n
n
 
 
 
(D) The number of binary strings of length 6m which are palindromes
with 2n 0’s.
(S)
1 2
1
n
n n
 
 +  
(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.
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
3. Choose the correct alternatives (more than one may be correct) and write the
corresponding letters only:
(i) The advantages of CMOS technology over a MOS is:
(a) lower power dissipation
(b) greater speed
(c) smaller chip size
(d) fewer masks for fabrication
(e) none of the above
(ii) Advantage of synchronous sequential circuits over asynchronous ones is:
(a) faster operation
(b) ease of avoiding problems due to hazards
(c) lower hardware requirement
(d) better noise immunity
(e) none of the above
(iii) The total size of address space is a virtual memory systems is limited by
(a) the length of MAR
(b) the available secondary storage
(c) the available main memory
(d) all of the above
(e) none of the above
(iv) The TRAP interrupt mechanism of the 8085 microprocessor:
(a) executes an instruction supplied by an external device through the INTA
signal
(b) executes an instruction from memory location 20H
(c) executes a NOP
(d) none of the above
(v) The ALE line of an 8085 microprocessor is used to:
(a) latch the output of an I/O instruction into an external latch
(b) deactivate the chip-select signal from memory devices
(c) latch the 8 bits of address lines AD7-AD0 into an external latch
(d) find the interrupt enable status of the TRAP interrupt
(e) None of the above
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
(vi) Kruskal’s algorithm for finding a minimum spanning tree of a weighted graph
G with vertices and m edges has the time complexity of:
(a) ( )2
O n
(b) ( )O mn
(c) ( )O m n+
(d) ( )logO m n
(e) ( )2
O m
(vii)The following sequence of operations is performed on a stack:
PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP,
PUSH (20), POP
The sequence of values popped out is:
(a) 20, 10, 20, 10, 20
(b) 20, 20, 10, 10, 20
(c) 10, 20, 20, 10, 20
(d) 20, 20, 10, 20, 10
(viii) 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
end
The function call X(N), if N is positive, will return
(a) ( )N
(b) ( ) 1N +
(c) N 
 
(d) 1N  +
 
(e) None of the above
(ix) A “link editor” is a program that:
(a) matches the parameters of the macro-definition with locations of the
parameters of the macro call
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
(b) matches external names of one program with their location in other
programs
(c) matches the parameters of subroutine definition with the location of
parameters of subroutine call.
(d) acts as link between text editor and the user
(e) acts as a link between compiler and user program.
(x) Indicate all the true statements from the following:
(a) Recursive descent parsing cannot be used for grammar with left recursion.
(b) The intermediate form the representing expressions which is best suited for
code optimization is the post fix form.
(c) A programming language not supporting either recursion or pointer type
does not need the support of dynamic memory allocation.
(d) Although C does not support call by name parameter passing, the effect can
be correctly simulated in C.
(e) No feature of Pascal violates strong typing in Pascal.
(xi) Indicate all the false statements from the statements given below:
(a) The amount of virtual memory available is limited by the availability of
secondary storage.
(b) Any implementation of a critical section requires the use of an indivisible
machine-instruction, such as test-and-set.
(c) The LRU page replacement policy may cause hashing for some type of
programs.
(d) The best fit techniques for memory allocation ensures the memory will never
be fragmented.
(xii)If 1 2 3, andF F F are propositional formulae such that
1 2 3 1 1 2and ~F F F F F F∧ → ∧ → are both tautologies, then which of the
following is true:
(a) Both 1 2andF F are tautologies
(b) The conjunction 1 2F F∧ is not satisfiable
(c) Neither is tautologous
(d) Neither is satisfiable
(e) None of the above
(xiii) Let ( )1 1 0 *, 11 * 0 and t 1 * 0r s= + = = be three regular expressions. Which
one of the following is true?
(a) ( ) ( ) ( ) ( )andL s L r L s L t⊆ ⊆
(b) ( ) ( ) ( ) ( )andL r L s L s L t⊆ ⊆
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
(c) ( ) ( ) ( ) ( )andL s L t L s L r⊆ ⊆
(d) ( ) ( ) ( ) ( )andL t L s L s L r⊆ ⊆
(e) None of the above
(xiv)Which one of the following is the strongest correct statement about a finite
language over some finite alphabet ?∑
(a) It could be undecidable
(b) It is Turing-machine recognizable
(c) It is a context-sensitive language
(d) It is a regular language
(e) None of the above
4. 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 ( ) ( )1 2 3, , if, stop,whilea a a =
(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.
SECTION – B
5. (a) Analyse the circuit in figure and complete the following table:
a b nQ
0 0
0 1
1 0
1 1
Q
a
b
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
(b) Find the minimum sum of products form of the logic function.
( ) ( ) ( ), , , 0,2,8,10,15 3,11,12,14f A B C D m d= +∑ ∑
Where m and d denote the min-terms 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 flip-flop and AND
gate is 10 ns. Also assume that the setup time for the JK inputs of the flip-
flops is negligible.
6. (a) Using D flip-flop and gates, design a parallel-in/serial-out 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 load / SHIFT .
(b) Design a 1024 bit serial-in/serial-out unidirectional shift register using a 1K ×
1 bit RAM with data input ,inD data output outD and control input
READ/ WRITE . You may assume that availability of standard SSI and MSI
components such as gates, registers and counters.
7. 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.
8. (a) Consider an 8085 based system operating with the following specification:
Crystal frequency : 6 MHz
ROM map : 0000 through 07FF
J0 Q0
K0 CK
J1 Q1
K1 CK
J2 Q2
K2 CK
Clock
1
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
PORT-DATE OUTPUT
WR OF PORT 40 H
INTERRUPT
BUFFULL
STROBE INPUT FROM DEVICE
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,
9. (a) Consider the following pseudo-code
(all data items are of type integer):
Procedure P (a, b, c);
a:=2;
c:=a+b;
end {P}
begin
x:=1
y:=5;
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
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 pseudo-code, indicate the output, if
(i) static scope rules and (ii) dynamic scope rules are used
Var, a, b : inteer;
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.
10. Consider the following grammar for arithmetic expression using binary operators
– and/which are not associative:
( )
E E T T
T
T
F F
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.
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
11. Consider the following scheme for implementing a critical section in a situation
with three processes and .j kP P
;iP
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
non-critical 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.
12. 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)
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
(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.
13. Give an optimal algorithm is pseudo-code for sorting a sequence of n numbers
which has only k distinct numbers (k is not known a Priori. Give a brief analysis
for the time-complexity of your algorithm).
14. 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 pseudo-code to delete an arbitrary node from such a
binary tree with n nodes that preserves the structure. What is the worst-case
time-complexity of your procedure?
15. (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
∧ →
∧ ∧ →
∧
5
7 13
1
18
20
25
27
11 9 15 17
GATE CS - 1991 www.gateforum.com
Join discussion of this test paper at http://forum.gatementor.com
Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question
Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank,
interaction with IISc alumni in our online discussion forums, and more. For more details,
visit
www.gateforum.com
Think GATE Think GATE Forum
(A-universal quantifier and E-existential quantifier)
Does it have finite models?
Is it satisfiable? Is so, give a countable model for it.
16.
(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.
17. (a) Show that Turing machines, which have a read only input tape and constant
size work tape, recognize preasely the class or regular languages.
(b) Let L be the language of all binary strings in which the third symbol from the
right is 1.a Give a non-deterministic finite automaton that recognizes L. How
many states does the minimized equivalent deterministic finite automaton
have? Justify your answer briefly?

More Related Content

What's hot (6)

Std 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQsStd 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQs
 
PGCET Computer science 2017 question paper
PGCET Computer science 2017 question paperPGCET Computer science 2017 question paper
PGCET Computer science 2017 question paper
 
Sample paper i.p
Sample paper i.pSample paper i.p
Sample paper i.p
 
Pgcet Computer Science 2015 question paper
Pgcet Computer Science 2015 question paperPgcet Computer Science 2015 question paper
Pgcet Computer Science 2015 question paper
 
CBSE Sample Paper IP
CBSE Sample Paper IPCBSE Sample Paper IP
CBSE Sample Paper IP
 
CS Sample Paper 1
CS Sample Paper 1CS Sample Paper 1
CS Sample Paper 1
 

Similar to Gate-Cs 1991

Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
guest3f9c6b
 
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
C O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{WwwC O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{Www
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
guest3f9c6b
 
Midterm Exam Solutions Fall03
Midterm Exam Solutions Fall03Midterm Exam Solutions Fall03
Midterm Exam Solutions Fall03
Radu_Negulescu
 
Specialist marketing officer professional knowledge questions.pdf(1)
Specialist marketing officer professional knowledge questions.pdf(1)Specialist marketing officer professional knowledge questions.pdf(1)
Specialist marketing officer professional knowledge questions.pdf(1)
Nivi Mohanty
 
Final Exam Solutions Fall02
Final Exam Solutions Fall02Final Exam Solutions Fall02
Final Exam Solutions Fall02
Radu_Negulescu
 

Similar to Gate-Cs 1991 (20)

Gate-Cs 1997
Gate-Cs 1997Gate-Cs 1997
Gate-Cs 1997
 
Gate-Cs 1995
Gate-Cs 1995Gate-Cs 1995
Gate-Cs 1995
 
Semester ii
Semester   iiSemester   ii
Semester ii
 
Cs 2001
Cs 2001Cs 2001
Cs 2001
 
Gate-Cs 1996
Gate-Cs 1996Gate-Cs 1996
Gate-Cs 1996
 
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
 
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
C O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{WwwC O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{Www
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
 
Midterm Exam Solutions Fall03
Midterm Exam Solutions Fall03Midterm Exam Solutions Fall03
Midterm Exam Solutions Fall03
 
Gate Previous Years Papers
Gate Previous Years PapersGate Previous Years Papers
Gate Previous Years Papers
 
sad.pdf
sad.pdfsad.pdf
sad.pdf
 
Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018
 
Specialist marketing officer professional knowledge questions.pdf(1)
Specialist marketing officer professional knowledge questions.pdf(1)Specialist marketing officer professional knowledge questions.pdf(1)
Specialist marketing officer professional knowledge questions.pdf(1)
 
Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019
 
Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)
 
Oop r&amp;s may 2019
Oop r&amp;s may 2019Oop r&amp;s may 2019
Oop r&amp;s may 2019
 
Gate-Cs 1993
Gate-Cs 1993Gate-Cs 1993
Gate-Cs 1993
 
B.Sc.IT: Semester – V (October – 2012) [Revised Course | Question Paper]
B.Sc.IT: Semester – V (October – 2012) [Revised Course | Question Paper]B.Sc.IT: Semester – V (October – 2012) [Revised Course | Question Paper]
B.Sc.IT: Semester – V (October – 2012) [Revised Course | Question Paper]
 
Final Exam Solutions Fall02
Final Exam Solutions Fall02Final Exam Solutions Fall02
Final Exam Solutions Fall02
 
B.Sc.IT: Semester – V (December – 2017) [Revised Course | Question Paper]
B.Sc.IT: Semester – V (December – 2017) [Revised Course | Question Paper]B.Sc.IT: Semester – V (December – 2017) [Revised Course | Question Paper]
B.Sc.IT: Semester – V (December – 2017) [Revised Course | Question Paper]
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 

More from Ravi Rajput

Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Ravi Rajput
 
Presentation on-video-conferencing-basics4468-ravi shankar-pc
Presentation on-video-conferencing-basics4468-ravi shankar-pcPresentation on-video-conferencing-basics4468-ravi shankar-pc
Presentation on-video-conferencing-basics4468-ravi shankar-pc
Ravi Rajput
 
Basic html tutorial
Basic html tutorialBasic html tutorial
Basic html tutorial
Ravi Rajput
 

More from Ravi Rajput (19)

Audio visual round fun quiz competition
Audio visual round fun quiz competitionAudio visual round fun quiz competition
Audio visual round fun quiz competition
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hacking
 
Mozilla Firefox 10 Principles
Mozilla Firefox 10 PrinciplesMozilla Firefox 10 Principles
Mozilla Firefox 10 Principles
 
Presentation over Wi-Fi technology
Presentation over Wi-Fi technologyPresentation over Wi-Fi technology
Presentation over Wi-Fi technology
 
UTU Syllabus for CSE & IT 2nd year
UTU Syllabus for CSE & IT 2nd yearUTU Syllabus for CSE & IT 2nd year
UTU Syllabus for CSE & IT 2nd year
 
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
 
Computer network unit 1 notes
Computer network unit  1 notesComputer network unit  1 notes
Computer network unit 1 notes
 
Cs gate-2012
Cs gate-2012Cs gate-2012
Cs gate-2012
 
Cs gate-2011
Cs gate-2011Cs gate-2011
Cs gate-2011
 
Gate-Cs 2010
Gate-Cs 2010Gate-Cs 2010
Gate-Cs 2010
 
Gate-Cs 2009
Gate-Cs 2009Gate-Cs 2009
Gate-Cs 2009
 
Gate-Cs 2008
Gate-Cs 2008Gate-Cs 2008
Gate-Cs 2008
 
Cs 2008(1)
Cs 2008(1)Cs 2008(1)
Cs 2008(1)
 
Gate-Cs 2007
Gate-Cs 2007Gate-Cs 2007
Gate-Cs 2007
 
Gate-Cs 2006
Gate-Cs 2006Gate-Cs 2006
Gate-Cs 2006
 
gate-Cs 2000
gate-Cs 2000gate-Cs 2000
gate-Cs 2000
 
4 sem unix 2011
4 sem unix 20114 sem unix 2011
4 sem unix 2011
 
Presentation on-video-conferencing-basics4468-ravi shankar-pc
Presentation on-video-conferencing-basics4468-ravi shankar-pcPresentation on-video-conferencing-basics4468-ravi shankar-pc
Presentation on-video-conferencing-basics4468-ravi shankar-pc
 
Basic html tutorial
Basic html tutorialBasic html tutorial
Basic html tutorial
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

Gate-Cs 1991

  • 1. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum SECTION - A 1. Fill in the blanks: (i) For the digital in figure, the expression for the output f is _________ (ii) In interleaved memory organization, consecutive words are stored in consecutive memory modules in ________ interleaving, whereas consecutive words are stored within the module in ________ interleaving. (iii) Consider the number given by the decimal expression: 3 2 16 * 9 16 * 7 16 * 5 3+ + + The number of 1’s in the unsigned binary representation of the number is ________. (iv) Using the 8087 arithmetic coprocessor with the 8087 CPU requires that the 8087 CPU is operated ________. (v) When two 4-bit binary number 3 2 1 0 3 2 1 0andA a a a a B b b b b= = are multiplied, the digit 1c of the product C is given by _________ (vi) 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 loop-invariant for the while-loop is ______ (vii)The minimum number of comparisons required to sort 5 elements is _____ a b x y f
  • 2. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum (viii) The weighted external path length of the binary tree in figure is _____ (ix) If the binary tree in figure is traversed in inorder, then the order in which the nodes will be visited is ______ (x) 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 ___________ (xi) The arithmetic expression : ( ) * / * *a b c d e f+ − is to be evaluated on a two- address machine, where each operands, the number of registers required to evaluate this expression is ______. The number of memory access of operand is __________. (xii)A given set of processes can be implemented by using only parbegin/parend statement, if the precedence graph of these processes is ________ (xiii) The number of integer-triples (i.j.k) with 1 ≤ i.j.k ≤ 300 such that i + j + k is divisible by 3 is ________ (xiv) If the longest chain in a partial order is of length n then the partial order can be written as a ______ of n antichains. (xv)The maximum number of possible edges in an undirected graph with a vertices and k components is ________. 15 9 10 7 5 42 1 4 6 7 3 5 2 8
  • 3. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum 2. Match the pairs in the following questions by writing the corresponding letters only. (i) (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) RS232-C (S) specifies the bus standard for the “backplane” bus called multibus. (ii) For the 8086 microprocessor: (iii) (A) Buddy system (P) Run-time type specification (B) Interpretation (Q) Segmentation (C) Pointer type (R) Memory allocation (D) Virtual memory (S) Garbage collection (iv) (A) The number distinct binary trees with n nodes (P) ! 2 n (B) The number of binary strings of length of 2n with an equal number of 0’s and 1’s (Q) 3n n       (C) The number of even permutations of n objects (R) 2n n       (D) The number of binary strings of length 6m which are palindromes with 2n 0’s. (S) 1 2 1 n n n    +   (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.
  • 4. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum 3. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: (i) The advantages of CMOS technology over a MOS is: (a) lower power dissipation (b) greater speed (c) smaller chip size (d) fewer masks for fabrication (e) none of the above (ii) Advantage of synchronous sequential circuits over asynchronous ones is: (a) faster operation (b) ease of avoiding problems due to hazards (c) lower hardware requirement (d) better noise immunity (e) none of the above (iii) The total size of address space is a virtual memory systems is limited by (a) the length of MAR (b) the available secondary storage (c) the available main memory (d) all of the above (e) none of the above (iv) The TRAP interrupt mechanism of the 8085 microprocessor: (a) executes an instruction supplied by an external device through the INTA signal (b) executes an instruction from memory location 20H (c) executes a NOP (d) none of the above (v) The ALE line of an 8085 microprocessor is used to: (a) latch the output of an I/O instruction into an external latch (b) deactivate the chip-select signal from memory devices (c) latch the 8 bits of address lines AD7-AD0 into an external latch (d) find the interrupt enable status of the TRAP interrupt (e) None of the above
  • 5. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum (vi) Kruskal’s algorithm for finding a minimum spanning tree of a weighted graph G with vertices and m edges has the time complexity of: (a) ( )2 O n (b) ( )O mn (c) ( )O m n+ (d) ( )logO m n (e) ( )2 O m (vii)The following sequence of operations is performed on a stack: PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP, PUSH (20), POP The sequence of values popped out is: (a) 20, 10, 20, 10, 20 (b) 20, 20, 10, 10, 20 (c) 10, 20, 20, 10, 20 (d) 20, 20, 10, 20, 10 (viii) 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 end The function call X(N), if N is positive, will return (a) ( )N (b) ( ) 1N + (c) N    (d) 1N  +   (e) None of the above (ix) A “link editor” is a program that: (a) matches the parameters of the macro-definition with locations of the parameters of the macro call
  • 6. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum (b) matches external names of one program with their location in other programs (c) matches the parameters of subroutine definition with the location of parameters of subroutine call. (d) acts as link between text editor and the user (e) acts as a link between compiler and user program. (x) Indicate all the true statements from the following: (a) Recursive descent parsing cannot be used for grammar with left recursion. (b) The intermediate form the representing expressions which is best suited for code optimization is the post fix form. (c) A programming language not supporting either recursion or pointer type does not need the support of dynamic memory allocation. (d) Although C does not support call by name parameter passing, the effect can be correctly simulated in C. (e) No feature of Pascal violates strong typing in Pascal. (xi) Indicate all the false statements from the statements given below: (a) The amount of virtual memory available is limited by the availability of secondary storage. (b) Any implementation of a critical section requires the use of an indivisible machine-instruction, such as test-and-set. (c) The LRU page replacement policy may cause hashing for some type of programs. (d) The best fit techniques for memory allocation ensures the memory will never be fragmented. (xii)If 1 2 3, andF F F are propositional formulae such that 1 2 3 1 1 2and ~F F F F F F∧ → ∧ → are both tautologies, then which of the following is true: (a) Both 1 2andF F are tautologies (b) The conjunction 1 2F F∧ is not satisfiable (c) Neither is tautologous (d) Neither is satisfiable (e) None of the above (xiii) Let ( )1 1 0 *, 11 * 0 and t 1 * 0r s= + = = be three regular expressions. Which one of the following is true? (a) ( ) ( ) ( ) ( )andL s L r L s L t⊆ ⊆ (b) ( ) ( ) ( ) ( )andL r L s L s L t⊆ ⊆
  • 7. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum (c) ( ) ( ) ( ) ( )andL s L t L s L r⊆ ⊆ (d) ( ) ( ) ( ) ( )andL t L s L s L r⊆ ⊆ (e) None of the above (xiv)Which one of the following is the strongest correct statement about a finite language over some finite alphabet ?∑ (a) It could be undecidable (b) It is Turing-machine recognizable (c) It is a context-sensitive language (d) It is a regular language (e) None of the above 4. 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 ( ) ( )1 2 3, , if, stop,whilea a a = (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. SECTION – B 5. (a) Analyse the circuit in figure and complete the following table: a b nQ 0 0 0 1 1 0 1 1 Q a b
  • 8. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum (b) Find the minimum sum of products form of the logic function. ( ) ( ) ( ), , , 0,2,8,10,15 3,11,12,14f A B C D m d= +∑ ∑ Where m and d denote the min-terms 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 flip-flop and AND gate is 10 ns. Also assume that the setup time for the JK inputs of the flip- flops is negligible. 6. (a) Using D flip-flop and gates, design a parallel-in/serial-out 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 load / SHIFT . (b) Design a 1024 bit serial-in/serial-out unidirectional shift register using a 1K × 1 bit RAM with data input ,inD data output outD and control input READ/ WRITE . You may assume that availability of standard SSI and MSI components such as gates, registers and counters. 7. 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. 8. (a) Consider an 8085 based system operating with the following specification: Crystal frequency : 6 MHz ROM map : 0000 through 07FF J0 Q0 K0 CK J1 Q1 K1 CK J2 Q2 K2 CK Clock 1
  • 9. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum PORT-DATE OUTPUT WR OF PORT 40 H INTERRUPT BUFFULL STROBE INPUT FROM DEVICE 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, 9. (a) Consider the following pseudo-code (all data items are of type integer): Procedure P (a, b, c); a:=2; c:=a+b; end {P} begin x:=1 y:=5;
  • 10. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum 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 pseudo-code, indicate the output, if (i) static scope rules and (ii) dynamic scope rules are used Var, a, b : inteer; 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. 10. Consider the following grammar for arithmetic expression using binary operators – and/which are not associative: ( ) E E T T T T F F 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.
  • 11. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum 11. Consider the following scheme for implementing a critical section in a situation with three processes and .j kP P ;iP 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 non-critical 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. 12. 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)
  • 12. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum (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. 13. Give an optimal algorithm is pseudo-code for sorting a sequence of n numbers which has only k distinct numbers (k is not known a Priori. Give a brief analysis for the time-complexity of your algorithm). 14. 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 pseudo-code to delete an arbitrary node from such a binary tree with n nodes that preserves the structure. What is the worst-case time-complexity of your procedure? 15. (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 ∧ → ∧ ∧ → ∧ 5 7 13 1 18 20 25 27 11 9 15 17
  • 13. GATE CS - 1991 www.gateforum.com Join discussion of this test paper at http://forum.gatementor.com Join All India Mock GATE Classroom Test Series - 2007 conducted by GATE Forum in over 25 cities all over India. Question Papers including section tests and full tests are designed by IISc alumni according to the latest syllabus. Percentile, All India Rank, interaction with IISc alumni in our online discussion forums, and more. For more details, visit www.gateforum.com Think GATE Think GATE Forum (A-universal quantifier and E-existential quantifier) Does it have finite models? Is it satisfiable? Is so, give a countable model for it. 16. (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. 17. (a) Show that Turing machines, which have a read only input tape and constant size work tape, recognize preasely the class or regular languages. (b) Let L be the language of all binary strings in which the third symbol from the right is 1.a Give a non-deterministic finite automaton that recognizes L. How many states does the minimized equivalent deterministic finite automaton have? Justify your answer briefly?