Q9.A bulb in a staircase has two switches, one switch being at the ground floor and the other one at the first floor. The bulb can be turned ON and also can be turned OFF by any one of the switches irrespective of the state of the other switch. The logic of switching of the bulb resembles
Answer : Option CExplaination / Solution:
Let A denotes the position of switch at ground floor and B denotes the position of switch at upper floor. The switch can be either in up position or down position.Following are the truth table given for different combinations of A and B
When the switches A and B are both up or both down, output will be zero (i.e.Bulb will be OFF). Any of the switch changes its position leads to the ON state of bulb. Hence, from the truth table, we get
For 8085 microprocessor, the following program is executed.
MVI A, 05H;
MVI B, 05H;
PTR: ADD B;
DCR B;
JNZ PTR;
ADI 03H;
HLT;
At the end of program, accumulator contains
Answer : Option AExplaination / Solution:
The program is being executed as follows
MVI A, 0.5H; A = 05H
MVI B, 0.5H; B = 05H
At the next instruction, a loop is being introduced in which for the instruction “DCR B” if the result is zero then it exits from loop so, the loop is executed five times as follows :
i.e., A = 05 + 05 + 04 + 03 + 02 + 01 = 144
At this stage, the 8085 microprocessor exits from the loop and reads the next instruction. i.e., the accumulator is being added to 03 H. Hence, we obtain A = A + 03 H = 14 + 03 = 17 H
Total Question/Mark :
Scored Mark :
Mark for Correct Answer : 1
Mark for Wrong Answer : -0.5
Mark for Left Answer : 0