> For the complete documentation index, see [llms.txt](https://bob-johns-book.gitbook.io/cyber-security-hand-book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bob-johns-book.gitbook.io/cyber-security-hand-book/gates-and-circuits.md).

# Gates and Circuits

A gate is a device that performs a basic operation on electrical signals. The input and output value is either a 1 or 0. The type of value determines the type of gate to use. There are six types of gates, and they are AND, OR, XOR, NOT, NAND, NOR and XNOR

#### NOT Gate&#x20;

* They are a inverter so if the input is 1 then the output is 0&#x20;

<figure><img src="/files/oJ2oMKup09m26IM221Ru" alt=""><figcaption></figcaption></figure>

#### AND Gate&#x20;

Unlike a Not Gate, the AND Gate inputs two input signals.&#x20;

<figure><img src="/files/sfDZBaSHPj33cqJdKQYS" alt=""><figcaption></figcaption></figure>

#### OR Gate

like the AND Gate, it has two inputs. There are two different inputs, 1 or 0&#x20;

<figure><img src="/files/9dcAZsyqzrpjRBdUS1ia" alt=""><figcaption></figcaption></figure>

#### XOR Gate&#x20;

The XOR takes two inputs, but if the two inputs are 0 then it is zero&#x20;

<figure><img src="/files/ZZ1CHnEklvVIp6rjNElE" alt=""><figcaption></figcaption></figure>

NAND and NOR Gates

The NAND and NOR gates are opposite the AND and OR gates.&#x20;

<figure><img src="/files/c0KDeNvZYpJhxVPEOXyq" alt=""><figcaption></figcaption></figure>

The behavior of gates and circuits includes Boolean expressions, Logic diagrams, and truth tables.

The logic diagram is a graphical representation of a circuit. A Truth table defines the function of a gate by listing all the possible input combinations that a gate could encounter, along with the outputs.

### Transistors&#x20;

A transistor is a device that acts depending on the voltage level.&#x20;
