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

GATE 2018

65 questions

MCQ 41 · NAT 241-mark 30 · 2-mark 35

Questions 31–35 of 65

Q31Function1 markNAT
Consider the following C program:
  #include <stdio.h>
int counter = 0;
int calc (int a, int b) {
    int c;
    counter++;
    if (b==3) return (a*a*a);
    else {
       c = calc(a, b/3);
       return (c*c*c);
           }
}
int main (){
calc(4, 81);
printf ("%d", counter);
}
The output of this program is _____.

Q32Sequential Circuit1 markNAT
Consider the sequential circuit shown in the figure, where both flip-flops used are positive edge-triggered D flip-flops.
in D Q D Q out clock
The number of states in the state transition diagram of this circuit that have a transition back to the same state on some value of "in" is _____.

Q33Memory Chip Design1 markNAT
A 32-bit wide main memory unit with a capacity of 1 GB is built using 256M x 4-bit DRAM chips. The number of rows of memory cells in the DRAM chip is 2142^{14}. The time taken to perform one refresh operation is 50 nanoseconds. The refresh period is 2 milliseconds. The percentage (rounded to the closest integer) of the time available for performing the memory read/write operations in the main memory unit is __________.

Q34Deadlock1 markNAT
Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of K instances. Resource instances can be requested and released only one at a time. The largest value of K that will always avoid deadlock is ____.

Q35Transport Layer Protocol1 markNAT
Consider a long-lived TCP session with an end-to-end bandwidth of 1 Gbps (= 10910^{9} bits-per-second). The session starts with a sequence number of 1234. The minimum time (in seconds, rounded to the closest integer) before this sequence number can be used again is _______.