![Light bulb](https://makercise.com/wp-content/uploads/2015/11/vlcsnap-2015-11-17-20h50m57s882.png.jpg)
You can think of a transistor as a "switch" with states "on" and "off"
## Digital Logic
- Learning about electricity, capacitors, resistors, is beyond the scope of this course
-
For now, it is useful to abstract away the details of electrical engineering
-
We will think about circuits in terms of 0s and 1s going through the wires of a circuit
## Input/Output as Voltages
- The 0s and 1s of our circuits will be "low" and "high" voltages across a wire, similar to a light bulb being "on" and "off"
![Bits as light bulbs](https://miro.medium.com/max/2400/1*Um-qKrB2QLxRU0C8CkCCeg.png)
## Logic Gates
- A **logic gate** is an elementary circuit that takes one or more bits as input and produces one or more bits as output
-
Many of these logic gates can be constructed with one or two transistors
## Name that Gate
![AND Gate](/teaching/2021f/cs130/assets/images/gates/and.png)
---
-
An **AND** gate
## Name that Gate
![OR Gate](/teaching/2021f/cs130/assets/images/gates/or.png)
---
-
An **OR** gate (inclusive OR)
## Name that Gate
![NOT Gate](/teaching/2021f/cs130/assets/images/gates/not.png)
---
-
A **NOT** gate
## Name that Gate
![NAND Gate](/teaching/2021f/cs130/assets/images/gates/nand.png)
---
-
A **NAND** gate
## Name that Gate
![NOR Gate](/teaching/2021f/cs130/assets/images/gates/nor.png)
---
-
A **NOR** gate
## Name that Gate
![XOR Gate](/teaching/2021f/cs130/assets/images/gates/xor.png)
---
-
An **XOR** gate (exclusive OR)
### What is the truth table for the following circuit?
---