Reputation: 1427
I am trying solve the following question:
Which of the following logic circuits meets the condition described below?
[Condition] A light is turned on and off by using switches A and B located at the top and bottom of the stairs. The light can be turned on and off by using one switch, regardless of the status of the other switch
Answer Options are:
The given Answer from the answer sheet is: d) XOR (How???)
I am confused by seeing the given answer. Please help me to understand it.
Upvotes: 0
Views: 573
Reputation: 41764
With XOR gate you can toggle the state of the output when toggling any one input
If both switches are in 0 state, the output is 0 and the light is off. Now switch on one switch and the output will be 1 (1 XOR 0 = 0 XOR 1 = 1), light will be turned on
If one switch is 0 and one is 1, i.e light is in ON state. Suppose A = 0 and B = 1 without loss of generality
If both switches is in 1 state, light is OFF. Toggling any switches will turn the light ON
Upvotes: 1
Reputation: 1488
If switch B is 0:
Switch A is 0 -> Output is 0
Switch A is 1 -> Output is 1
If switch B is 1:
Switch A is 0 -> Output is 1
Switch A is 1 -> Output is 0
As you can see, we can control the output using only one switch, regardless of the state of the other switch.
Upvotes: 2