Logical Gates

1. AND Gate :

An AND gate is a logic gate having two or more inputs and a single output. An AND gate operates on logical multiplication rules. In this gate, if either of the inputs is low (0), then the output is also low. If all of the inputs are high (1), then the output will also be high. An AND gate can have any number of inputs, although 2 input and 3 input AND gates are the most common.
There are two binary digits 0 and 1. We just told that an AND gate performs a binary multiplication of binary digits. In multiplying 0 with 0 we will get 0, 1 with 0 or 0 with 1 we will get 0. Only we get 1 when 1 is multiplied by 1. In other words, an AND gate is a digital device that produces high output only when all inputs are high and produces low output under all other inputs conditions. A high digital signal means logically 1 and a low digital signal means logically 0.

Truth Table
A B A AND B
0 0 0
1 1 1
0 1 0
1 0 0
2. OR Gate :

An OR gate is a digital circuit that has two or more inputs and produces an output, which is the logical OR of all those inputs. This logical OR is represented with the symbol ‘+’.
The following table shows the truth table of 2-input OR gate.

Truth Table
A B A OR B
0 0 0
1 1 1
0 1 1
1 0 1

Here A, B are the inputs and Y is the output of two input OR gate. If both inputs are ‘0’, then only the output, Y is ‘0’. For remaining combinations of inputs, the output, Y is ‘1’.

3. NOT Gate :

A NOT gate is a digital circuit that has single input and single output. The output of NOT gate is the logical inversion of input. Hence, the NOT gate is also called as inverter.
The following table shows the truth table of NOT gate.

Truth Table
A A'
0 1
1 0
4. NAND Gate

NAND gate is a digital circuit that has two or more inputs and produces an output, which is the inversion of logical AND of all those inputs.
The following table shows the truth table of 2-input NAND gate.

Truth Table
A B (A.B)’
0 0 0
1 1 1
0 1 1
1 0 1

Here A, B are the inputs and Y is the output of two input NAND gate. When both inputs are ‘1’, the output, Y is ‘0’. If at least one of the input is zero, then the output, Y is ‘1’. This is just opposite to that of two input AND gate operation.

5. NOR Gate

NOR gate is a digital circuit that has two or more inputs and produces an output, which is the inversion of logical OR of all those inputs.
The following table shows the truth table of 2-input NOR gate

Truth Table
A B (A+B)’
0 0 1
1 1 0
0 1 0
1 0 0

Here A, B are the inputs and Y is the output. If both inputs are ‘0’, then the output, Y is ‘1’. If at least one of the input is ‘1’, then the output, Y is ‘0’. This is just opposite to that of two input OR gate operation.

6. X-OR Gate

The full form of Ex-OR gate is Exclusive-OR gate. Its function is same as that of OR gate except for some cases, when the inputs having even number of ones.
The following table shows the truth table of 2-input Ex-OR gate.

Truth Table
A B A XOR B
0 0 0
1 1 0
0 1 1
1 0 1

Here A, B are the inputs and Y is the output of two input Ex-OR gate.The only modification is the output Y is zero instead of one, when both the inputs are one, since the inputs having even number of ones. Therefore, the output of Ex-OR gate is ‘1’, when only one of the two inputs is ‘1’. And it is zero, when both inputs are same.