GATE-CS-2017 (Set 1) (original) (raw)

Consider a RISC machine where each instruction is exactly 4 bytes long. Conditional and unconditional branch instructions use PC- relative addressing mode with Offset specified in bytes to the target location of the branch instruction. Further the Offset is always with respect to the address of the next instruction in the program sequence. Consider the following instruction sequence

If the target of the branch instruction is i, then the decimal value of the Offset is __________.

**Note: This questions appeared as Numerical Answer Type.

Consider the following two functions

void fun1(int n){

 if(n == 0) return;   
 printf(“%d”, n);   
 fun2(n-2);  
 printf(“%d”, n);    

}

void fun2(int n){

 if(n == 0) return;   
 printf(“%d”, n);   
 fun1(++n);  
 printf(“%d”, n);    

}

The output printed when fun1 (5) is called is

The value of the given expression:

[Tex]\lim_{x \to 1} \frac{x^7-2x^5+1}{x^3-3x^2+2}[/Tex]

In the Stop-and-Wait ARQ protocol, which factor mainly reduces channel efficiency?

In a database system, unique time stamps are assigned to each transaction using Lamport’s logical clock. Let TS(T1) and TS(T2) be the time stamps of transactions T1 and T2 respectively. Besides, T1 holds a lock on the resource R, and T2 has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database assuming that a killed transaction is restarted with the same timestamp.

if TS(T2) <TS(T1) then
T1 is killed
else T2 waits.

Assume any transactions that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?

Let A be m×n real valued square symmetric matrix of rank 2 with expression given below.

[Tex]\sum_{i=1}^{n} \sum_{j=1}^{n} A_{ij}^2 = 50[/Tex]

Consider the following statements

(i) One eigenvalue must be in [-5, 5].
(ii) The eigenvalue with the largest magnitude
must be strictly greater than 5.

Which of the above statements about eigenvalues of A is/are necessarily CORRECT?

In a RSA cryptosystem a particular A uses two prime numbers p = 13 and q =17 to generate her public and private keys. If the public key of Ais 35. Then the private key of A is ____________.

**Note: This questions appeared as Numerical Answer Type.

If G is grammar with productions

S → SaS | aSb | bSa | SS | ∈

where S is the start variable, then which one of the following is not generated by G?

Consider the following grammar over the alphabet {a,b,c} given below, S and T are non-terminals.

G1: S-->aSb|T
T--> cT|∈

G2: S-->bSa|T
T--> cT|∈

The language L1(G1) ∩ L2(G2).

Consider a 2-way set associative cache with 256 blocks and uses LRU replacement, Initially the cache is empty. Conflict misses are those misses which occur due the contention of multiple blocks for the same cache set. Compulsory misses occur due to first time access to the block. The following sequence of accesses to memory blocks

(0,128,256,128,0,128,256,128,1,129,257,129,1,129,257,129)

is repeated 10 times. The number of conflict misses experienced by the cache is ___________.

**Note:

This questions appeared as Numerical Answer Type.

There are 65 questions to complete.

Take a part in the ongoing discussion