• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE CSE 2023

Question 31

A particular number is written as 132 in the radix-4 representation. The same number in the radix-5 representation is

  • 110

  • 010

  • 001

  • 011

Question 32

Consider a 3-stage pipelined processor having a delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for the first, second, and third stages, respectively. Assume that there is no other delay and the processor does not suffer from any pipeline hazards. Also, assume that one instruction is fetched every cycle.

The total  execution  time  for  executing  100  instructions  on  this  processor  is _____________ ns

  • 1020

  • 102

  • 2023

  • 2040

Question 33

A keyboard connected to a computer is used at a rate of 1 keystroke per second. The computer system polls the keyboard every 10 ms (milliseconds) to check for a keystroke and consumes 100 μs (microseconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes an additional 200 μs to process the keystroke. Let T1 denote the fraction of a second spent in polling and processing a keystroke.

In an alternative implementation,  the system uses interrupts instead of polling. An interrupt is raised for every keystroke. It takes a total of 1 ms for servicing an interrupt and processing a keystroke. Let T2 denote the fraction of a second spent in servicing the interrupt and processing a keystroke.
T1
The ratio T1/T2 is (Rounded off to one decimal place)

  • 5.1

  • 0.0001

  • 0.005

  • 10.2

Question 34

The integer value printed by the ANSI-C program given below is.
#include<stdio.h>

int funcp(){
static int x = 1; x++;
return x;
}

int main(){
int x,y;
x = funcp();
y = funcp()+x; printf("%d\n", (x+y)); return 0;
}

  • 2

  • 3

  • 4

  • 7

Question 35

Consider the following program

int main()     int f1(){                int f2(int X){                   int f3(){
{                 return (1);            f3();                             return (5);
f1();           }                       if(X==1)                          }
f2(2);                                     return f1();
f3();                                   else
return(0);                                 return (X+f2(X-1));
}                                        }

Which of the following options represents the activation tree corresponding to the main function?

  • a

  • b

  • c

  • d

Question 36

Consider the control flow graph shown.

[caption width="800"]img[/caption]

Which one of the following choices correctly lists the set of live variables at the exit point of each basic block?

  • B1: {}, B2: {a}, B3: {a}, B4: {a}

  • B1: {i, j}, B2: {a}, B3: {a}, B4: {i}

  • B1: {a, i, j}, B2: {a, i, j}, B3: {a, i}, B4: {a}

  • B1: {a, i, j}, B2: {a, j}, B3: {a, j}, B4: {a, i, j}

Question 37

Consider the two functions incr and decr shown below.

incr(){	                                     decr(){
wait(s);	                                 wait(s);
X = X+1;	                                 X = X-1;
signal(s);	                                 signal(s);
}                                            }

There are 5 threads each invoking incr once, and 3 threads each invoking decor once, on the same shared variable X. The initial value of X is 10.

Suppose there are two implementations of the semaphore s, as follows:

I-1: s is a binary semaphore initialized to 1.
I-2: s is a counting semaphore initialized to 2.

Let V1, and V2 be the values of X at the end of the execution of all the threads with implementations I-1, and y

I-2, respectively.

Which one of the following choices corresponds to the minimum possible values of V1, V2, respectively?

  • 15,7

  • 7,7

  • 12,7

  • 12,8

Question 38

Consider the context-free grammar G below
S → aSb | X
X → aX | Xb | a | b ,
where S and X are non-terminals, and a and b are terminal symbols. The starting non-terminal is S.

Which one of the following statements is CORRECT?

  • The language generated by G is (a + b)∗

  • The language generated by G is a∗(a + b)b∗

  • The language generated by G is a∗b∗(a + b)

  • The language generated by G is not a regular language

Question 39

Consider the pushdown automaton (PDA) P below, which runs on the input alpha-bet {a, b},  has  stack alphabet  {⊥, A},  and  has three states  {s, p, q},  with s  being the start state.  A transition from state u to state v, labelled c/X/γ, where c is an input symbol or ϵ, X is a stack symbol, and γ is a string of stack symbols, represents the fact that in-state u, the PDA can read c from the input, with X on the top of its stack, pop X from the stack, push in the string γ on the stack, and go to state v. In the initial configuration, the stack has only the symbol ⊥ in it. The PDA accepts by the empty stack.

[caption width="800"]img[/caption]

Which one of the following options correctly describes the language accepted by P ?

  • {ambn| 1<m and n<m}

  • {ambn | 0 ≤ n ≤ m}

  • {ambn | 0 ≤ m and   0 ≤ n}

  • {am | 0 ≤ m}∪ {bn | 0 ≤ n}

Question 40

Consider the given code and its corresponding assembly code, with a few operands being unknown. Some useful information as well as the semantics of each unique assembly instruction is annotated as inline comments in the code. The memory is byte-addressable.

[caption width="800"]IMG [/caption]

Which one of the following options is a replacement for operands in the position in the above assembly code?

  • (8,4,1,L02)

  • (3,4,4,L01)

  • (8,1,1,L02)

  • (3,1,1,L01)

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion