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

GATE 2016 (Session 1)

65 questions

MCQ 39 · NAT 261-mark 30 · 2-mark 35

Questions 56–60 of 65

Q56Syntax-directed Translation2 marksMCQ−0.67 if wrong
Consider the following Syntax Directed Translation Scheme(SDTS),with non-terminals {S, A} and terminals {a, b}.
S →\rightarrow aA {print 1}
S →\rightarrow a { print 2}
A →\rightarrow Sb { print 3}
Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:

Q57Memory Management2 marksNAT
Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is _________ mega bytes.

Q58Disk Scheduling2 marksNAT
Consider a disk queue with requests for I/O to blocks on cylinders 47,38,121,191,87,11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving to wards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0to 199. The total head movement (in number of cylinders) incurred while servicing these requests is____ .

Q59Memory Management2 marksNAT
Consider a computer system with ten physical page frames. The system is provided with an access sequence (a1,a2,...,a20,a1,a2,...,a20)(a_{1},a_{2},...,a_{20},a_{1},a_{2},...,a_{20}), where each aia_{i} is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is ______.

Q60Process Synchronization2 marksMCQ−0.67 if wrong
Consider the following proposed solution for the critical section problem. There are n processes: P0...Pn−1P_{0}...P_{n-1} . In the code,function pmaxpmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.
Code for Pi:
do {
    c[i]=1; t[i] = pmax(t[0],...,t[n-1])+1; c[i]=0;
    for every j ≠ i in {0,...,n-1} {
        while (c[j]);
        while (t[j] != 0 && t[j]<=t[i]);
    }
    Critical Section;
    t[i]=0;
    Remainder Section;
} while (true);

Which one of the following is TRUE about the above solution?