GATE 2023
65 questions
MCQ 34 · MSQ 15 · NAT 161-mark 30 · 2-mark 35
Questions 31–35 of 65
The value of the definite integral is _____. (Rounded off to the nearest integer)
Answer: 0
Given integral:
Integrate with respect to z:
Put in the limits:
Integrate with respect to y:
The value is 0.
Answer: 0
Integrate with respect to z:
Put in the limits:
Integrate with respect to y:
The value is 0.
Answer: 0
A particular number is written as 132 in radix-4 representation. The same number in radix-5 representation is _____.
Answer: 110
Radix-4 to decimal:
Now change 30 into base 5:
Answer: 110
Now change 30 into base 5:
Answer: 110
Consider a 3-stage pipelined processor having a delay of 10 ns (nanoseconds), 20 ns, and 14 ns, for the first, second, and the 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
The total execution time for executing 100 instructions on this processor is _______ ns
Answer: 2040
The clock cycle is set by the slowest stage, so cycle time = 20 ns.
The number of cycles needed for n instructions on k stages: .
Total time ns
Answer: 2040
The number of cycles needed for n instructions on k stages: .
Total time ns
Answer: 2040
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 (milli seconds) to check for a keystroke and consumes 100 (micro seconds) for each poll. If it is determined after polling that a key has been pressed, the system consumes an additional 200 to process the keystroke. Let 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 denote the fraction of a second spent in servicing the interrupt and processing a keystroke. The ratio is ______ . (Rounded off to one decimal place)
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 denote the fraction of a second spent in servicing the interrupt and processing a keystroke. The ratio is ______ . (Rounded off to one decimal place)
Answer: 10.2
Polling: 100 polls each second (one per 10 ms) 100 s gives 10 ms. Add 200 s for the single keystroke ms per second.
Interrupts: one keystroke each second 1 ms ms per second.
Answer: 10.2
Interrupts: one keystroke each second 1 ms ms per second.
Answer: 10.2
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;
}
Answer: 7
The static x inside funcp keeps its value from one call to the next. It starts at 1.
- First call, x = funcp() the static x becomes 2 so x = 2
- Second call, y = funcp() + x the static x becomes 3 so y = 3 + 2 = 5
Then x + y = 7
Answer: 7
- First call, x = funcp() the static x becomes 2 so x = 2
- Second call, y = funcp() + x the static x becomes 3 so y = 3 + 2 = 5
Then x + y = 7
Answer: 7