← Back

What is a logic gate? Explanation about AND, OR, NOT, NAND, NOR, XOR, and XNOR:

What is a logic gate?

A logic gate is an electronic circuit that operates on one or more digital signals to produce an output signal.

A logic gate performs a logical operation such as AND, OR, NOT, etc. on one more logic input (1 or 0) and produces a single logic output (1 or 0). Logic gates process signals which represent "true" or "false'. Usually, the positive supply voltage +5 Volts means 'true' and zero (0) Volt represents 'false'.

Logic Gates

Logic States Table:

True False
1 0
High Low
+5 V 0 V
On Off

Types of logic Gates:

The manipulation of binary information is done by logic circuits known as logic gates. Different types of logic operations frequently performed in the design of digital systems are: AND, OR, NOT, NAND, NOR, EX-OR, and EX-NOR. An electronic circuit that performs a logic operation is called a logic gate. For example, the electronic circuit which performs OR operation is called OR gate, which serves AND operations is known as AND gate, and so on.

AND Gate:

AND gate has two or more inputs and a single output. An input signal applied to a gate has only two stable states, either input signal applied to a gate has only two stable states, either 1 (high) or 0 (low). The logical operation of the AND gate is such that the output is 1 (high) when all the inputs are 1 (high), otherwise, it is low (0).

AND Gate

Truth Table:

Input Output
A B C = A + B
0 0 0
0 1 0
1 0 0
1 1 1

OR Gate:

The OR gate has two or more input signals but only one output signal. If any of the input signals is 1 (true or high) then the output is 1 (true or high). In electronics, we use integrated circuits that are designed to perform the role of OR operator. Such a functional switch is named as OR gate.

OR Gate

Truth Table:

Input Output
A B C = A + B
0 0 0
0 1 1
1 0 1
1 1 1

NOT Gate:

NOT gate reverses the input signal value. If the input value is '1', the output value will be '0', then the output value will be '1'. NOT gate also can be called as inverter too.

NOT Gate

Truth Table:

Input Output
A B
0 1
1 0

NAND Gate:

NAND gate has two or more inputs and a single output. The NAND function is the complement of AND function. An AND gate can be combined with an Inverter to form a NAND gate. The term NAND is formed by the concatenation NOT-AND and implies an AND function with an inverted output.

NAND Gate

Truth Table:

Input Output
A B C = A + B
0 0 1
0 1 1
1 0 1
1 1 0

NOR Gate:

The NOR gate has two or more inputs and a single output. The NOR function is the complement of the OR function. An OR gate can be combined with an Inverter to form a NOR gate. The term NOR is formed by the concatenation NOT-OR and implies an OR function with an inverted output.

NOR Gate

Truth Table:

Input Output
A B C = A + B
0 0 1
0 1 0
1 0 0
1 1 0

XOR Gate:

XOR is also known as Exclusive-OR. In this logical operator, the output is 1 (true) when both the inputs are of opposite types. If A is true, then B should be false to get an output value of true. When the inputs A and B have the same type of values say true or false, the output is always false. Thus, when both the inputs are the same, the output is 0 or false. When the inputs are of the opposite type, then the output is 1 or more.

XOR Gate

Truth Table:

Input Output
A B C = A + B
0 0 0
0 1 1
1 0 1
1 1 0

XNOR Gate:

XNOR is also known as Exclusive-NOR. The XNOR gate is logically equivalent to an inverted XOR i.e. XOR gate followed by NOT gate (an inverter). The XNOR gate produces '1' (high) only when the logical voltage of both inputs A and B are the same. The output is '0' when the inputs are of the opposite type.

XNOR Gate

Truth Table:

Input Output
A B C = A + B
0 0 1
0 1 0
1 0 0
1 1 1

Note: A truth table is the pictorial representation of a boolen expression containing Boolen variables for showing results of possible combination input. The input boolen variables will have one of the two states '0' or '1', TRUE or FALSE.