## Circuits

Circuits can be used to operate on binary values.

Our two values, $1$ and $0$, can be used in Boolean Logic to manipulate expressions. Binary $1$ and $0$ maps to true and false in Boolean Logic.

• Circuits have input wires, contain gates connected by wires, and have output wires.
• Combinational logic circuits have no state.
• Sequential logic circuits have a state.

### Truth Tables

Truth tables lay out true/false values for Boolean expressions, for each possible input.

$$\textcolor{pink}{\text{AND}}\\a\cdot b\\ \begin{array}{cc|c} \text{a}&\text{b}&\text{Y}\\ \hline 0&0&0\\ 0&1&0\\ 1&0&0\\ 1&1&1 \end{array}$$

$$\textcolor{pink}{\text{OR}}\\a+ b\\ \begin{array}{cc|c} \text{a}&\text{b}&\text{Y}\\ \hline 0&0&0\\ 0&1&1\\ 1&0&1\\ 1&1&1 \end{array}$$

$$\textcolor{pink}{\text{XOR}}\\ \begin{array}{cc|c} \text{a}&\text{b}&\text{Y}\\ \hline 0&0&0\\ 0&1&1\\ 1&0&1\\ 1&1&0 \end{array}$$

$$\textcolor{pink}{\text{NOT}}\\\overline a\\ \begin{array}{c|c} \text{a}&\text{Y}\\ \hline 0&1\\ 1&0\\ \end{array}$$

### Transistors

Transistors are solid-state switches.

• They change state when given power from a control line.
• There can be billions of transistors in microprocessors.

A transistor diagram.

## Logic Gates

A logic gate represents a simple truth table.

The different gates require different numbers of transistors.

• $\text{NOT}$ gates require one transistor.
• $\text{AND}$ and $\text{OR}$ gates require three transistors.
• $\text{NAND}$ and $\text{NOR}$ gates require two transistors.

Logic gates that correspond to truth tables.

$\text{NAND}$ and $\text{NOR}$ gates are functionally complete, meaning you can build any other gate from them.

### DeMorgan's Law

DeMorgan's Law gives us guidelines for the transformation of circuit expressions.

$$\overline{\overline{A}\cdot \overline{B}}=A+B\\ {\overline{A}\cdot \overline{B}}=\overline{A+B}\\ \overline{\overline{A}+ \overline{B}}=A\cdot B\\ {\overline{A}+ \overline{B}}=\overline{A\cdot B}$$

However, for larger expressions, it may be easier to make a truth table for your equation and then base your new equation on that.