GATE 2001
60 questions
MCQ 601-mark 60
Questions 26–30 of 60
More than one word are put in one cache block to
Answer: (B)
The answer is to exploit the spatial locality of reference in a program. If the next location is accessed right after, it is already in the cache.
Think of cooking. When you take one ingredient from the cupboard, you also pick the nearby ingredients, hoping you will need them soon.
Correct Answer:
Think of cooking. When you take one ingredient from the cupboard, you also pick the nearby ingredients, hoping you will need them soon.
Correct Answer:
A slow memory can be connected to 8085 by using
Answer: (D)
A slow memory is connected to the 8085 through the READY signal. The 8085 checks READY during a read or write. If READY is low, it adds wait states and holds the cycle until READY goes high. This gives the slow memory time to respond. So option (D) is the one.
The others do not fit: INTR (the interrupt request input) asks for an interrupt service, HOLD is used by a DMA controller to ask for the bus, and RESET IN restarts the processor. None of them adds wait states.
Answer: (D)
The others do not fit: INTR (the interrupt request input) asks for an interrupt service, HOLD is used by a DMA controller to ask for the bus, and RESET IN restarts the processor. None of them adds wait states.
Answer: (D)
A CPU has two modes-privileged and non-privileged. In order to change the mode from privileged to non-privileged
Answer: (D)
An interrupt or a trap takes the CPU from non-privileged mode into privileged mode, so a hardware interrupt (A) or a software interrupt (B) is the way to go up, not down.
Protection exists to stop user programs from gaining privilege. Giving up privilege is harmless, so it does not have to be guarded by a privileged instruction. In this model, a plain non-privileged instruction that does not raise an interrupt can lower the mode. So option C (a privileged instruction) is not needed, and option D is right.
Answer: (D)
Protection exists to stop user programs from gaining privilege. Giving up privilege is harmless, so it does not have to be guarded by a privileged instruction. In this model, a plain non-privileged instruction that does not raise an interrupt can lower the mode. So option C (a privileged instruction) is not needed, and option D is right.
Answer: (D)
A processor needs software interrupt to
Answer: (C)
A software interrupt (trap or system call) is an instruction that causes an interrupt. It switches the processor from user mode to kernel mode and enters the operating system. User programs cannot run privileged instructions (for example, I/O) directly, so they use a software interrupt to ask the OS to do it. So the processor needs it to get system services that need privileged instructions.
(A) A software interrupt can be used to test, but that is not why a processor needs it. (B) Co-routines switch control between routines in user mode with normal jumps, so no mode change is needed. (D) A return from a subroutine uses the return instruction, which pops the return address, so no interrupt is needed.
Answer: (C)
(A) A software interrupt can be used to test, but that is not why a processor needs it. (B) Co-routines switch control between routines in user mode with normal jumps, so no mode change is needed. (D) A return from a subroutine uses the return instruction, which pops the return address, so no interrupt is needed.
Answer: (C)
Consider the following program
Program P2
var n: int:
procedure W(var x: int)
begin
x=x+1;
print x;
end
procedure D
begin
var n: int;
n=3;
W(n);
end
begin //beginP2
n=10;
D;
end If the language has dynamic scooping and parameters are passed by reference, what will be printed by the program ?Answer: (D)
D has its own local variable n, set to . The call W(n) inside D uses that n, because it is the n visible in D. The global n () is not used.
W gets the parameter by reference, so x is another name for D's n. Then makes D's n equal to , and
The program prints 4, which is not among (A), (B) and (C).
Answer: (D)
W gets the parameter by reference, so x is another name for D's n. Then makes D's n equal to , and
print x prints .The program prints 4, which is not among (A), (B) and (C).
Answer: (D)