Switches
A switch has two values:
- Open (off)
- Closed (on)
In practice, those are transistors (we will see that in another lecture) The symbol for a switch:
Example
Suppose we have a light controlled by a switch. The output of the light can be labeled as
- If the light is on, we will say that
- Else, We can describe the state of the light with a logical expression:
Two Variable Logic Functions
If we have two switches inline , it behaves as an AND:
- Both switches have to be closed for the light to be on
- It is written as ""
If we have two switches in parallel, it behaves as an OR:
- Either switch can be closed to turn on the light
- It is written as ""
We can have a switch bypass a light, by going around it, we call this a Complement (NOT):
- It is written as a bar over the variable: ""