logic gate
(Redirected from logic gates)

Not to be confused with ideal logic gate.

A logic gate is a simple device that gives a discrete output of either 0 or 1 based on the input condition. Logic gates implement Boolean functions and are the fundamental building blocks of all digital systems. Logic gates can be implemented using discrete components such as resistors, diodes, and transistors.

Sometimes a combination of logic gates may be more efficiently implemented as a single device. Those devices are known as compound logic gate.

## Symbology

There are many different symbols that can be used to represent basic logic gates. Some areas of the world may be required to follow a specific standard. The four main standards that attempt to provide a uniform method of describing complex logic functions are:

Note that the inversion bubble is used across most of those standards. In this article, the ANSI symbols are used.

## Gates

### Buffer

A Q
0 0
0 0

Main article: Buffer

A Buffer is a gate that outputs the very same input it is given. Its primarily used to regenerate the input into either a strong LOW or a strong HIGH. In some cases this gate might be used to simply show that the output from some component is not degraded.

This gate implements the following Boolean function: ${\displaystyle Q=A}$

### Tri-state Buffer

EN A Q
0 X Z
1 A A

Main article: Tri-state Buffer

A Tri-state Buffer is a gate that outputs the very same input it is given only when the control signal allows it. When the control signal is off, the output is at high impedance. This gate forms the basis for buses, by controlling which devices is allow to generate output to a shared bus.

### NOT Gate

A Q
0 1
1 0

Main article: NOT gate

The NOT gate or an inverter produces an output that's the opposite to its input - if the input is HIGH, the output is LOW, and conversely when the input is LOW, the output is HIGH.

This gate implements the following Boolean function: ${\displaystyle Q={\bar {A}}=\neg A}$

### AND Gate

A B Q
0 0 0
0 1 0
1 0 0
1 1 1

Main article: AND gate

An AND gate outputs a HIGH only when both inputs are HIGH, otherwise it outputs a LOW. The Boolean AND operation is equivalent to the Boolean multiplication operation.

The AND gate implements the following Boolean function: ${\displaystyle Q=AB=A\land B=A\&B=A\cdot B}$

### OR Gate

A B Q
0 0 0
0 1 1
1 0 1
1 1 1

Main article: OR gate

The OR gate outputs a HIGH if any of its inputs are HIGH, otherwise it outputs a LOW. This function is equivalent to the Boolean addition function.

The OR gate implements the following Boolean function: ${\displaystyle Q=A+B=A\lor B}$

### XOR Gate

A B Q
0 0 0
0 1 1
1 0 1
1 1 0

Main article: XOR gate

The XOR gate (Exclusive-OR gate) outputs a HIGH when both inputs differ, otherwise it outputs a LOW. That is, the output is HIGH when one of the inputs are HIGH exclusively.

The XOR gate implements the following Boolean function: ${\displaystyle Q=A{\underline {\lor }}B=A\oplus B=(A\neq B)}$

### NAND Gate

A B Q
0 0 1
0 1 1
1 0 1
1 1 0

Main article: NAND gate

The NAND gate (NOT AND) outputs a HIGH so long both inputs are not HIGH, otherwise it outputs a LOW.

This gate implements the following Boolean function: ${\displaystyle Q={\overline {A\wedge B}}=A{\overline {\wedge }}B={\overline {A\,B}}=A|B}$

### NOR Gate

A B Q
0 0 1
0 1 0
1 0 0
1 1 0

Main article: NOR gate

The NOR gate outputs a HIGH only when both inputs are LOW, otherwise it outputs a LOW.

This gate implements the following Boolean function: ${\displaystyle Y={\overline {A\vee B}}=A{\overline {\vee }}B={\overline {A+B}}=A-B}$

### XNOR Gate

A B Q
0 0 1
0 1 0
1 0 0
1 1 1

Main article: XNOR gate

The XNOR gate (Exclusive-NOR") outputs a HIGH when both inputs are the same, otherwise it outputs a LOW.

This gate implements the following Boolean function: ${\displaystyle Y={\overline {A{\underline {\lor }}B}}=A{\overline {\underline {\lor }}}B={\overline {A\oplus B}}=A\odot B}$