Question 31
A particular number is written as 132 in the radix-4 representation. The same number in the radix-5 representation is
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
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)
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;
}
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?
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?
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?
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?
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 ?
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"] [/caption]Which one of the following options is a replacement for operands in the position in the above assembly code?
There are 65 questions to complete.