GATE 2020 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2020

64 questions

MCQ 41 · NAT 231-mark 29 · 2-mark 35

Questions 51–55 of 64

Q52Combination2 marksNAT
The number of permutations of the characters in LILAC so that no character appears in its original position, if the two L's are indistinguishable, is ______.

Q53Pipeline Processor2 marksNAT
Consider a non-pipelined processor operating at 2.5 GHz. It takes 5 clock cycles to complete an instruction. You are going to make a 5-stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at 2 GHz. In a given program, assume that 30% are memory instructions, 60% are ALU instructions and the rest are branch instructions. 5% of the memory instructions cause stalls of 50 clock cycles each due to cache misses and 50% of the branch instructions cause stalls of 2 cycles each. Assume that there are no stalls associated with the execution of ALU instructions. For this program, the speedup achieved by the pipelined processor over the non-pipelined processor (round off to 2 decimal places) is________.

Q54Machine Instruction2 marksNAT
A processor has 64 registers and uses 16-bit instruction format. It has two types of instructions: I-type and R-type. Each I-type instruction contains an opcode, a register name, and a 4-bit immediate value. Each R-type instruction contains an opcode and two register names. If there are 8 distinct I-type opcodes, then the maximum number of distinct R-type opcodes is _______.

Q55Probability Theory2 marksNAT
For n>\gt2, let a∈{0,1}na \in \{0,1\}^n be a non-zero vector. Suppose that x is chosen uniformly at random from {0,1}n\{0,1\}^n. Then, the probability that ∑i=1naixi\sum_{i=1}^{n}a_ix_i is an odd number is______

Q56Function2 marksNAT
Consider the following C functions.
int fun1(int n) {
  static int i = 0;
  if (n > 0) {
    ++i;
    fun1(n-1);
  }
  return(i);
}
int fun2(int n) {
  static int i = 0;
  if (n > 0) {
    i = i + fun1(n);
    fun2(n-1);
  }
  return(i);
}

The return value of fun2(5) is ______