user5005768Himadree
user5005768Himadree

Reputation: 1427

How can the XOR gate make the given circuit?

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

Switch circuilt

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

Answers (2)

phuclv
phuclv

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 we switch A to 1, light will be OFF (1 XOR 1 = 0)
    • If we switch B to 0, light will also be OFF (0 XOR 0 = 0)
  • If both switches is in 1 state, light is OFF. Toggling any switches will turn the light ON

Upvotes: 1

starikcetin
starikcetin

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

Related Questions