- 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.
Contents
Symbology[edit]
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:
- ANSI/IEEE Std 91-1984 (MIL/ANSI)
- IEC 60617-12 / BS 3939 (British)
- DIN 40700 (German)
- NEMA ICS 19-2002
Note that the inversion bubble is used across most of those standards. In this article, the ANSI symbols are used.
Gates[edit]
Buffer[edit]
A | Q |
---|---|
0 | 0 |
1 | 1 |
- 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:
Tri-state Buffer[edit]
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[edit]
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:
AND Gate[edit]
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:
OR Gate[edit]
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:
XOR Gate[edit]
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:
NAND Gate[edit]
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:
NOR Gate[edit]
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:
XNOR Gate[edit]
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: