GATE 2000
54 questions
MCQ 541-mark 54
Questions 21–25 of 54
To put the 8085 microprocessor in the wait state
Answer: (B)
The 8085 checks the READY input during the T2 state of a read or write cycle. If READY is high, the cycle goes on normally. If READY is low, the processor inserts wait states () and keeps waiting until READY goes high again. This lets a slow memory or I/O device finish. So to put the 8085 in the wait state, lower the READY input.
(D) is wrong, since raising READY means the device is ready and no wait is inserted. (A) and (C) are wrong, since HOLD is a different signal: raising it is a bus request (for DMA), which makes the processor release its buses in a hold state, not a wait state.
Answer: (B)
(D) is wrong, since raising READY means the device is ready and no wait is inserted. (A) and (C) are wrong, since HOLD is a different signal: raising it is a bus request (for DMA), which makes the processor release its buses in a hold state, not a wait state.
Answer: (B)
The most appropriate matching for the following pairs is:
Answer: (C)
The instruction format is |opcode|mode|address field|. Match each mode with its typical use:
- Indirect addressing (X): the address field gives the place where the address of the operand is stored, . This is how pointers work, so X matches 2.
- Immediate addressing (Y): the operand itself is in the address field. This is used for constants, so Y matches 3.
- Auto-decrement addressing (Z): the register is reduced first and then used as the address, . This suits counting down in loops, so Z matches 1.
Here EA is the effective address, the place where the operand is found.
Answer: (C)
- Indirect addressing (X): the address field gives the place where the address of the operand is stored, . This is how pointers work, so X matches 2.
- Immediate addressing (Y): the operand itself is in the address field. This is used for constants, so Y matches 3.
- Auto-decrement addressing (Z): the register is reduced first and then used as the address, . This suits counting down in loops, so Z matches 1.
Here EA is the effective address, the place where the operand is found.
Answer: (C)
The 8085 microprocessor responds to the presence of an interrupt
Answer: (C)
The 8085 never breaks off an instruction in the middle. Towards the end of every instruction (in its next-to-last clock state), it samples its interrupt inputs, including TRAP. If TRAP is high then, the processor finishes the instruction and then starts the interrupt service.
Option A is wrong, because the processor does not react as soon as the pin goes high; it first completes the instruction in progress.
Option D is wrong, because the pin is not checked at regular time intervals (as a timer would do); it is checked once per instruction, so the delay depends on how long the instruction is.
Option B is wrong, because the check is not made when the instruction fetch ends; it is made while the instruction finishes executing. Option C states this correctly.
Answer: (C)
Option A is wrong, because the processor does not react as soon as the pin goes high; it first completes the instruction in progress.
Option D is wrong, because the pin is not checked at regular time intervals (as a timer would do); it is checked once per instruction, so the delay depends on how long the instruction is.
Option B is wrong, because the check is not made when the instruction fetch ends; it is made while the instruction finishes executing. Option C states this correctly.
Answer: (C)
Comparing the time T1 taken for a single instruction on a pipelined CPU with time T2 taken on a non-pipelined but identical CPU, we can say that
Answer: (B)
Here we compare the time for one instruction from start to end (its latency).
Let a CPU have stages with delays .
(non-pipelined).
(pipelined), since the clock must fit the slowest stage plus the latch delay, and the instruction passes through all stages.
The sum of the stage delays is at most , so . They are equal only when all stages are equal and the latch delay is zero. Pipelining does not make one instruction faster. It gives a gain because a new instruction finishes every clock.
So (A) and (C) are wrong. (D) is wrong too: the extra time comes from the latch delays and the unequal stage delays, not from one extra instruction fetch cycle.
Answer: (B)
Let a CPU have stages with delays .
(non-pipelined).
(pipelined), since the clock must fit the slowest stage plus the latch delay, and the instruction passes through all stages.
The sum of the stage delays is at most , so . They are equal only when all stages are equal and the latch delay is zero. Pipelining does not make one instruction faster. It gives a gain because a new instruction finishes every clock.
So (A) and (C) are wrong. (D) is wrong too: the extra time comes from the latch delays and the unequal stage delays, not from one extra instruction fetch cycle.
Answer: (B)
The value of j at the end of the execution of the following C program:
int incr (int i)
{
static int count = 0;
count = count + i;
return (count);
}
main () {
int i, j;
for (i = 0; i <= 4; i++)
j = incr (i);
} is:Answer: (A)
count is a static variable, so it is created once and keeps its value between calls. Each call adds i to count and returns the new count, so j after the call is the running sum of i.
- : count = 0, so j = 0
- : count = 1, so j = 1
- : count = 3, so j = 3
- : count = 6, so j = 6
- : count = 10, so j = 10
So j ends as .
Answer: (A)
- : count = 0, so j = 0
- : count = 1, so j = 1
- : count = 3, so j = 3
- : count = 6, so j = 6
- : count = 10, so j = 10
So j ends as .
Answer: (A)