All digital equipment, whether simple or complex, is constructed of only a few basic circuits. These circuits, referred to as logic elements, perform some logic function on binary data.

There are two basic types of logic circuits: decision-making and memory. Decision-making logic circuits monitor binary inputs and produce an output based on the status of the inputs and the characteristics of the logic circuit. Memory circuits are used to store binary data.

# Types of Logic Gates

There are **three types of logic gates**: universal gates, primary gates and secondary gates. The universal gates include NOR gate and NAND gate. The primary or we can say the main gates are NOT gates, AND gates, OR gates.

## The AND Gate

The AND gate is a logic circuit that has two or more inputs and a single output. The AND gate produces an output of 1, only when all its inputs are 1s. If any of the inputs are 0s, the output is 0.

Figure 1 shows the standard symbol used for AND gates. An AND gate can have any number of inputs greater than one. Shown in the figure are symbols representing the more commonly used gates of two, three, four, and eight inputs.

The operation of the AND gate is summarized by the table in Figure 1. Such a table, called a truth table, shows the output for each possible input. The inputs are designated A and B. The output is designated Y.

The total number of possible combinations in the truth table is determined by the following formula:

N = 2^{n}

Where: **N** = the total number of possible combinations

**n** = the total number of input variables

**EXAMPLE**:

For two input variables, N = 2^{2} = 4

For three input variables, N = 2^{3} = 8

For four input variables, N = 2^{4} = 16

For eight input variables, N = 2^{8} = 256

The AND gate performs the basic operation of multiplication. Multiplication is known as the AND function. The output of an AND gate is represented by the equation Y = A⋅B or Y = AB. The AND function is represented by the dot between the two variables A and B.

## The OR Gate

An OR gate produces a 1 output if any of its inputs are 1s. The output is a 0 if all the inputs are 0s. The output of a two-input OR gate is shown in the truth table in Figure 2.

The total number of possible combinations is expressed by N = 2^{2} = 4. The truth table shows all four combinations.

An OR gate performs the basic operation of addition. The algebraic expression for the output of an OR gate is Y = A+B. The plus sign designates the OR function.

Figure 2 shows the logic symbol for an OR gate. The inputs are labeled **A** and **B**, and the output is labeled **Y**. An OR gate can have any number of inputs greater than one. Shown in the figure are OR gates with two, three, four, and eight inputs.

## The NOT Gate

The simplest logic circuit is the NOT gate. It performs the function called inversion, or complementation, and is commonly referred to as an inverter. The purpose of the inverter is to make the output state the opposite of the input state. The two states associated with logic circuits are 1 and 0.

A **1 **state can also be referred to as a high, to indicate that the voltage is higher than in the **0** state. A **0** state can also be referred to as a low, to indicate that the voltage is lower than in the **1** state.

If a 1, or high, is applied to the input of an inverter, a low, or 0, appears on its output. If a 0, or low, is applied to the input, a 1, or high, appears on its output. The operation of an inverter is summarized in Figure 3. The input to an inverter is labeled A and the output is labeled Ā(read “A NOT” or “NOTA”).

The bar over the letter A indicates the complement of A. Because the inverter has only one input, only two input combinations are possible. The symbol used to represent an inverter or NOT function is shown in Figure 3.

The triangle portion of the symbol represents the circuit, and the circle or “bubble” represents the circuit inversion or complementary characteristic. The choice of symbol depends on where the inverter is used. If the inverter uses a 1 as the qualifying input, the symbol in Figure 3–A is used. If the inverter uses a 0 as the qualifying input, the symbol in Figure 3–B is used.

## The NAND Gate

A NAND gate is a combination of an inverter and an AND gate. It is called a NAND gate from the NOT-AND function it performs. The NAND gate is the most commonly used logic function. This is because it can be used to construct an AND gate, OR gate, inverter, or any combination of these functions.

The logic symbol for a NAND gate is shown in Figure 4. Also shown is its equivalency to an AND gate and an inverter. The bubble on the output end of the symbol means to invert the AND function.

Figure 4 shows the truth table for a two-input NAND gate. Notice that the output of the NAND gate is the complement of the output of an AND gate. Any 0 in the input yields a 1 output.

NAND gates are available with two, three, four, eight, and thirteen inputs. NAND gates are the most widely available gates on the market. The availability and flexibility of the NAND gate allows it to be used for other.

## The NOR Gate

A NOR gate is a combination of an inverter and an OR gate. Its name derives from its NOT-OR function. Like the NAND gate, the NOR gate can also be used to construct an AND gate, an OR gate, and an inverter. The logic symbol for the NOR gate is shown in Figure 6. Also shown is its equivalency to an OR gate and an inverter. The bubble on the output of the symbol means to invert the OR function.

Figure 6 shows the truth table for a two-input NOR gate. Notice that the output is the complement of the OR-function output. A **1** occurs only when **0** is applied to both inputs. A **1** input produces a **0** output. NOR gates are available with two, three, four, and eight inputs.

## The Exclusive OR Gate

A less common but still important gate is called an exclusive OR gate, abbreviated as XOR. An XOR gate has only two inputs, unlike the OR gate, which may have several inputs.

However, the XOR is similar to the OR gate in that it generates a **1** output if either input is a **1**. The exclusive OR is different when both inputs are **1**s or **0**s. In that case, the output is a **0**.

The symbol and truth table for an XOR gate is shown in Figure 7. Also shown is the equivalent logic circuit.

## The XNOR Gate

The complement of the XOR gate is the XNOR (exclusive NOR) gate. Its symbol and truth table is shown in Figure 8. The bubble on the output implies inversion or complement. Also shown is the equivalent logic circuit.

## The Buffer Gate

A buffer is a special logic gate that isolates conventional gates from other circuitry and provides a high driving current for heavy circuit loads or fan-out. Buffers provide non-inverting input and output. A **1** in provides a **1** out and a **0 **in provides a **0** out.

Figure 9 shows the schematic symbol for a basic buffer with its truth table. Another type of buffer is the 3-state buffer shown with its truth table in Figure 10.

The 3-state buffer has the usual 1 and 0 output states but it also has a third state, which is referred to as a high-impedance state. This state provides an open circuit between the input circuitry and the output and is controlled by the EN line. The EN line represents an enable/disable control input.

## Summary

- An AND gate produces a 1 output when all of its inputs are 1s.
- An AND gate performs the basic operation of multiplication.
- An OR gate produces a 1 output if any of its inputs are 1s.
- An OR gate performs the basic operation of addition.
- A NOT gate performs the function called inversion or complementation.
- A NOT gate coverts the input state to an opposite output state.

- A NAND gate is a combination of an AND gate and an inverter.
- A NAND gate produces 1 output when any of the inputs are 0s.
- A NOR gate is a combination of an OR gate and an inverter.
- A NOR gate produces a 1 output only when both inputs are 0s.
- An exclusive OR (XOR) gate produces a 1 output only if both inputs are different.
- An exclusive NOR (XNOR) gate produces a 1 output only when both inputs are the same.

- A buffer isolates conventional gates from other circuitry.
- A buffer provides a high current for heavy loads or fan-outs.
- A 3-state buffer has a high-impedance third state.

Thanks for reading about “**types of logic gates**“.