GATE 2014 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2014 (Session 1)

65 questions

MCQ 40 · NAT 251-mark 30 · 2-mark 35

Questions 51–55 of 65

Q51Loop2 marksMCQ−0.67 if wrong
Consider the following C function in which size is the number of elements in the array E:
 int MyX(int *E, unsigned int size)
{
  int Y = 0;
  int Z;
  int i, j, k; 
    for(i = 0; i < size; i++)
    Y = Y + E[i];
  for(i = 0; i < size; i++)
    for(j = i; j < size; j++)
    {
       Z = 0;
       for(k = i; k <= j; k++)
           Z= Z + E[k];
       if (Z > Y)
            Y = Z;
   }
return Y;
}
The value returned by the function MyX is the

Q52Loop2 marksMCQ−0.67 if wrong
Consider the following pseudo code. What is the total number of multiplications to be performed?
 D= 2
for i = 1 to n do
   for j = i to n do
      for k = j + 1 to n do
           D = D * 3 

Q53Pipeline Processor2 marksNAT
Consider a 6-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is executing on this 6-stage pipeline, the speedup achieved with respect to non-pipelined execution if 25% of the instructions incur 2 pipeline stall cycles is _________.

Q54Cache Memory2 marksMCQ−0.67 if wrong
An access sequence of cache block addresses is of length N and contains n unique block addresses. The number of unique block addresses between two consecutive accesses to the same block address is bounded above K. What is the miss ratio if the access sequence is passed through a cache of associativity A≥\geqk exercising least-recently-used replacement policy?

Q55Combinational Circuit2 marksMCQ−0.67 if wrong
Consider the 4-to-1 multiplexer with two lines S1 and S0 given below.
01R R 0123 F PQ 4 – to – 1 Multiplexer s1 s0
The minimal sum of-products form of the Boolean expression for the output F of the multiplexer is