Search code examples
logicdiagramboolean-logiccircuit-diagram

Logic-based light system


Circuit with red bulb

I need to develop a system that turns on the red light when all three switches are off, and turns on the orange light when any two out of three switches are off. The red light part is already sorted with a simple NOR gate. I'm having trouble with the orange light however. The orange light must be off when the red light is on. So only two out of three switches can be off when the orange light is on. If one switch is off, nothing happens, both lights remain on. Same if all switches are on. If any two out of three switches are off, only the orange light goes on. If all three switches are off, only the red light goes on. I can't get the logic to have this all working at once, anyone have any idea? I used the logic.ly editor to do this.

Many thanks in advance.

Inputs  |  Outputs
C  B  A | Red   Orange
--------+--------------
0  0  0 |  1      0
0  0  1 |  0      1
0  1  0 |  0      1
0  1  1 |  0      0
1  0  0 |  0      1
1  0  1 |  0      0
1  1  0 |  0      0
1  1  1 |  0      0

Solution

  • The simplest more or less canonical form here is Zhegalkin polynomial: A&B&C⊕A⊕B⊕C.

    Hence:

    Orange bulb2

    or

    Orange bulb3

    Unfortunately, the "red" circuit you have already build can not be effectively reused when building the "orange" one.


    The logic.ly editor also supports the one-hot generalization of XOR, which gives the simplest solution for the "orange" circuit:

    IEEE xor


    The whole circuit:

    IEEE xor