What we have is a power source (like a battery), a switch, and a lightbulb, like a simple flashlight. When the switch is open, the light is off. When the switch is closed, the light is on. This gives us open is a zero, and closed is a one. Now you should see this is a binary situation, and we can have a digital system.
We can show that in a truth table:
| Switch 2 | |||
|---|---|---|---|
| Open | Closed | ||
| Switch 1 | Open | Off | Off | 
| Closed | Off | On | |
We can show that in a truth table:
| Switch 2 | |||
|---|---|---|---|
| Open | Closed | ||
| Switch 1 | Open | Off | On | 
| Closed | On | On | |
Now we can take those switches and package them as "gates", giving us an AND gate and a OR gate. We need one other basic gate, the NOT gate. It takes a one an makes it a zero or takes a zero and makes it a one.
| AND | OR | NOT | 
|---|---|---|
![]()  | ![]()  | ![]()  | 
| NOT | A' | ![]()  | ~A |    |  
     
  | |||||||||||||||
| AND | A · B | XY | X^Y | ![]()  | 
     
  | |||||||||||||||
| OR | A + B | A \/ B | ~A |    |   
     
  | 






It gets hairy!
 
Contemporary Logic Design, 2nd Edition, Randy Katz and Gaetano Borriello, 2005, Prentice Hall, Page 47