Logic Gates in Digital Circuits
Digital circuits used in devices from simple calculators to supercomputers contain small electronic switches called transistors. In modern processors, their number reaches millions and even billions. Logic gates are basic elements of digital circuits that realize logical functions through transistor connections. A logic gate is a device that performs a basic logical function based on . It takes one or more binary inputs (0s and 1s) and produces a single binary output based on a specific rule.
In digital circuits, logic gates process signals. By combining them, engineers build circuits that perform arithmetic, store data, and make decisions.
Basic Logic Gates
The set of AND, OR, and NOT gates can realize any Boolean function. The three gates are introduced below in turn.
1. The AND Gate
The AND gate performs conjunction, also called the Boolean product. Its output is '1' (True) only if all of its inputs are '1'. If any input is '0', the output is '0'. It can be compared to a series circuit with two switches: the light bulb turns on only when both switches are closed.
ANSI Symbol for AND gate
Truth Table (A AND B)
| Input A | Input B | Output Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Logical Expression: or
2. The OR Gate
The OR gate performs disjunction, also called the Boolean sum. Its output is '1' (True) if at least one of its inputs is '1'. The output is '0' only when all inputs are '0'. It can be compared to a parallel circuit: the light bulb turns on if either switch (or both) is closed.
ANSI Symbol for OR gate
Truth Table (A OR B)
| Input A | Input B | Output Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Logical Expression:
3. The NOT Gate (Inverter)
The NOT gate has one input and one output. It performs negation by inverting the input signal. If the input is '1', the output is '0', and if the input is '0', the output is '1'.
ANSI Symbol for NOT gate
Truth Table (NOT A)
| Input A | Output Y |
|---|---|
| 0 | 1 |
| 1 | 0 |
Logical Expression: or
Universal gates: NAND and NOR
Besides the AND, OR, and NOT set, NAND and NOR are universal gates. Any Boolean function can be realized by combining only NAND gates or only NOR gates.
4. The NAND Gate (NOT-AND)
The NAND gate performs negated conjunction and can be described as an AND gate with an inverted output. Its output is '0' only if all of its inputs are '1'. Otherwise, the output is '1'.
ANSI Symbol for NAND gate
Truth Table (A NAND B)
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Logical Expression:
5. The NOR Gate (NOT-OR)
The NOR gate performs negated disjunction and can be described as an OR gate with an inverted output. Its output is '1' only when all inputs are '0'. If any input is '1', the output is '0'.
ANSI Symbol for NOR gate
Truth Table (A NOR B)
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Logical Expression:
Exclusive gates: XOR and XNOR
XOR and XNOR detect whether input values differ or match. Examples of their applications include arithmetic circuits and circuits that check data.
6. The XOR Gate (Exclusive OR)
The XOR gate's output is '1' only if the inputs are different. If the inputs are the same (both '0' or both '1'), the output is '0'. XOR gates are used in adders and parity-checking circuits.
ANSI Symbol for XOR gate
Truth Table (A XOR B)
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Logical Expression:
7. The XNOR Gate (Exclusive NOR)
The XNOR gate is an XOR gate with an inverted output. Its output is '1' only if the inputs are the same. It implements an equality test for two bits.
ANSI Symbol for XNOR gate
Truth Table (A XNOR B)
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Logical Expression: