Recent questions tagged gate1992

1
Design a $3-$bit counter using D-flip flops such that not more than one flip-flop changes state between any two consecutive states.
2
Consider the function $F(n)$ for which the pseudocode is given below : Function F(n) begin F1 ← 1 if(n=1) then F ← 3 else For i = 1 to n do begin C ← 0 For j = 1 to n – 1 do begin C ← C + 1 end F1 = F1 * C end F = F1 end [$n$ is a positive integer greater than zero] Solve the recurrence relation for a closed form solution of $F(n)$.
3
Show the activation records and the display structure just after the procedures called at lines marked $x$ and $y$ have started their execution. Be sure to indicate which of the two procedures named $A$ you are referring to. Program Test; Procedure A; Procedure B; Procedure A; begin …… end A; begin y: A; end B; begin B; end A; begin x: A; end Test
4
Write $3$ address intermediate code (quadruples) for the following boolean expression in the sequence as it would be generated by a compiler. Partial evaluation of boolean expressions is not permitted. Assume the usual rules of precedence of the operators.$(a+b) > (c+d) \text{ or } a > c \text{ and }b < d$
5
Let the page reference and the working set window be $c\ c\ d\ b\ c\ e\ c\ e\ a\ d\$ and $4$, respectively. The initial working set at time $t=0$ contains the pages $\{a,d,e\}$, where $a$ was referenced at time $t=0$, $d$ was ... $t=-2$. Determine the total number of page faults and the average number of page frames used by computing the working set at each reference.
6
Suppose we have a database consisting of the following three relations: ... which snacks are liked by each customer. Express the following query in relational algebra: Print the hotels the serve the snack that customer Rama likes.
7
Consider the set of integers $\{1,2,3,4,6,8,12,24\}$ together with the two binary operations LCM (lowest common multiple) and GCD (greatest common divisor). Which of the following algebraic structures does this represent? group ring field lattice
1 vote
8
Let $S$ be the set of all integers and let $n > 1$ be a fixed integer. Define for $a,b \in S, a R b$ iff $a-b$ is a multiple of $n$. Show that $R$ is an equivalence relation and find its equivalence classes for $n = 5$.
9
Consider the SLR(1) and LALR(1) parsing tables for a context free grammar. Which of the following statements is/are true? a] The goto part of both tables may be different. b] The shift entries are identical in both the tables c] The reduce entries in the tables may be different d] The error entries in the tables may be different.
10
Three devices $A, B$ and $C$ are connected to the bus of a computer, input/output transfers for all three devices use interrupt control. Three interrupt request lines INTR1, INTR2 and INTR3 are available with priority of INTR1 > priority of INTR2 > priority of INTR3. Draw a ... of the priority logic, using an interrupt mask register, in which Priority of $A$ > Priority of $B$ > Priority of $C.$
11
Which of the following three statements are true? Prove your answer. The union of two recursive languages is recursive. The language $\{O^n \mid n\text{ is a prime} \}$ is not regular. Regular languages are closed under infinite union.
12
Use Modus ponens $(A, A → B |= B)$ or resolution to show that the following set is inconsistent: $Q(x) → P (x) \vee \sim R (a)$ $R (a) \vee \sim Q(a)$ $Q(a)$ $\sim P (y)$ where $x$ and $y$ are universally quantified variables, $a$ is a constant and $P, Q, R$ are monadic predicates.
13
If $G$ is a group of even order, then show that there exists an element $a≠e$, $e$, the identity in $G$, such that $a^2 = e$.
14
How is redundancy reduced in the following models? Hierarchical Network Relational
15
Draw the precedence graph for the concurrent program given below S1 parbegin begin S2:S4 end; begin S3; parbegin S5; begin S6:S8 end parend end; S7 parend; S9
16
Write syntax directed definitions (semantic rules) for the following grammar to add the type of each identifier to its entry in the symbol table during semantic analysis. Rewriting the grammar is not permitted and semantic rules are to be added to the ends of productions only. $D \rightarrow TL;$ $T \rightarrow \text{int}$ $T \rightarrow \text{real}$ $L \rightarrow L,id$ $L \rightarrow id$
1 vote
17
What type of parameter passing mechanism (call-by-value, call-by-reference, call-by-name, or-by-value result) is the following sequence of actions trying to implement for a procedure call $P (A[i])$ where P (i:integer) is a procedure and A is an integer array? Is the implementation correct? ... , say z. Assign to z the value of A[i]. Execute the body of P using z for A[i] Set A[i] to z.&#8203;
18
Suggest a data structure for representing a subset $S$ of integers from $1$ to $n$. Following operations on the set $S$ are to be performed in constant time (independent of cardinality of $S$ ... operations in an English like language. You may assume that the data structure has been suitable initialized. Clearly state your assumptions regarding initialization.
19
Let $T$ be a Depth First Tree of a undirected graph $G$. An array $P$ indexed by the vertices of $G$ is given. $P[V]$ is the parent of vertex $V$, in $T$. Parent of the root is the root itself. Give a method for finding and printing the ... be proportional to the length of the cycle. Describe the algorithm in a PASCAL $(C)$ - like language. Assume that the variables have been suitably declared.
20
Consider the function $F(n)$ for which the pseudocode is given below : Function F(n) begin F1 ← 1 if(n=1) then F ← 3 else For i = 1 to n do begin C ← 0 For j = 1 to n – 1 do begin C ← C + 1 end F1 = F1 * C end F = F1 end [$n$ is a positive integer greater than zero] (a) Derive a recurrence relation for $F(n)$
21
A microprocessor is capable of addressing 1 megabyte of memory with a 20-bit address bus. The system to be designed requires 256 K bytes of RAM, 256 K bytes of EPROM, 16 I/O devices (memory mapped I/O) and 1 K byte of EERAM (electrically ... equivalent to two clock cycles for memory read and write. Assuming control signals similar to 8085, design the extra logic required for interfacing EERAM.
22
The access times of the main memory and the Cache memory, in a computer system, are $500$ $n sec$ and $50$ $nsec$, respectively. It is estimated that $80$% of the main memory request are for read the rest for write. The hit ratio for the read ... a write-through policy (where both main and cache memories are updated simultaneously) is used. Determine the average time of the main memory (in ns)
23
Consider addition in two's complement arithmetic. A carry from the most significant bit does not always correspond to an overflow. Explain what is the condition for overflow in two's complement arithmetic.
24
Start and stop bits do not contain any "information" but are used in serial communication for Error detection Error correction Synchronization Slowing down the communications.
25
Assume that the last element of the set is used as partition element in Quicksort. If $n$ distinct elements from the set $\left[1\dots n\right]$ are to be sorted, give an input for which Quicksort takes maximum time.
26
How many edges can there be in a forest with $p$ components having $n$ vertices in all?
27
Mention the pass number for each of the following activities that occur in a two pass assembler: object code generation literals added to literal table listing printed address resolution of local symbols
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: In which of the cases stated below is the following statement true? "For every non-deterministic machine $M_{1}$ there exists an equivalent deterministic machine $M_{2}$ recognizing ... $M_{1}$ is a non-deterministic Turing machine. For no machines $M_{1}$ and $M_2$, the above statement true.
Choose the correct alternatives (more than one may be correct) and write the corresponding letters only: If $G$ is a context free grammar and $w$ is a string of length $l$ in $L(G)$, how long is a derivation of $w$ in $G$, if $G$ is in Chomsky normal form? $2l$ $2l +1$ $2l -1$ $l$