Electronic – How to complete circuit diagram

diagramdrawingwiring

I have limited knowledge on electrics and wanted to ask how I can complete this circuit, how would I go about wiring it up?

  1. Bulb should ONLY be ON when Input A is ON and Input B is OFF.

  2. Bulb should turn OFF whenever Input B is ON or when both Inputs are OFF or when both Inputs are ON.

  3. Input A is always ON when Input B is ON.

Is there any semiconductor or electrical device I need for it? If someone can redraw diagram including if there is anything else to add like ground wire to make this work I would appreciate it a lot.

Incomplete circuit

Best Answer

You want the logical function:

BULB = A and (not B)

This can be realized directly with a inverter and a AND gate if all the signals are positive logic. This equation can also be re-written to use different blocks and for different polarity of the inputs and/or output. For example, the above is equal to:

BULB = (not A) nor B

Such simple logic can be implemented with just a couple of transistors when speed isn't critical. For example:

For the light to turn on, transistor Q2 must be on. This can only happen when A is high to supply its base current. However, when B is high, the base of Q2 will always be low regardless of what A is doing.

Added in response to misguided comments

The OP's point number 3 is telling us what the inputs do, not what the circuit must do in response. It is really telling us that one line in the truth table isn't used. Point 1 tells us the whole truth table. My circuit above works correctly for all possible combinations of inputs, so the fact that one of the four possible input states never occurs doesn't matter.

From the OP's point 1, the truth table is:

      A     B   OUT
    ---   ---   ---
1:    0     0     0
2:    0     1     0
3:    1     0     1
4:    1     1     0

Point 3 only states that line 2 never occurs. Again, this does not matter to my circuit since it implements the full truth table. Another way of saying this is that we could show the OUT value for line 2 as "don't care".

As for the comment that I need to show the "switch wiring", that makes even less sense. The OP never referred to any switches, so it make no sense that I need to show any. My circuit does use transistors are switches, but these are already clearly shown, and there is a explanation below the diagram on how the circuit works.

Response to more confused comments

The OP's point 3 says "Input A is always ON when Input B is ON". This is a statement of what is, not a description of some action the circuit must perform. This simple statement is being consistantly misinterpreted as the rule: "he specified that input A must be ON whenever input B is ON". The error in interpretation is that this is being taken as a rule that the circuit must somehow turn on A when B is on. This is simply not what the OP's original statement means. Note that A and B are inputs. By definition, we don't control inputs. Since there are 2 inputs and each can have one of two states, there are only a total of 4 possible input conditions. Since the number is small, it is easy to deal with them by exhaustion, such as by using the truth table shown.

This is like writing a specification for a solar panel installation and saying that the sun is always south of vertical at noon. This is only meant as additional information, not as a requirement that the sun be rearranged to force it south at noon.

The OP's point 3 is like the sun at noon. It is giving us additional information, which is that when input B is on, we will always find input A also on. The specification of what the circuit needs to do is spelled out clearly in point 1: "Bulb should ONLY be ON when Input A is ON and Input B is OFF". This tells us that in the case of A off and B on, the output should be off. Point 3 is giving us the additional information that this case will never occur. It would therefore be legitimate for the circuit to have undetermined output or have the output on in the case of A off and B on. The circuit I showed above happens to produce the desired output in that case anyway. That is not necessary, but it also does no harm.