Logic Gates
Logic Gates
AND Gate
In digital electronics, the AND gate is one of the basic logic gate that
performs the logical multiplication of inputs applied to it. It generates a
high or logic 1 output, only when all the inputs applied to it are high or
logic 1. Otherwise, the output of the AND gate is low or logic 0.
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate
In digital electronics, there is a type of basic logic gate which produces a
low or logic 0 output only when its all inputs are low or logic 0. For all
other input combinations, the output of the OR gate is high or logic 1.
This logic gate is termed as OR gate. An OR gate can be designed to
have two or more inputs but only one output. The primary function of the
OR gate is to perform the logical sum operation.
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1
Symbol of OR Gate:
The logic symbol of a two-input OR gate is shown in the following figure.
NOT Gate
In digital electronics, the NOT gate is another basic logic gate used to
perform compliment of an input signal applied to it. It takes only one
input and one output. The output of the NOT gate is complement of the
input applied to it. Therefore, if we apply a low or logic 0 output to the
NOT gate is gives a high or logic 1 output and vice-versa. The NOT gate
is also known as inverter, as it performs the inversion operation.
The logical operation of the NOT gate is described by its boolean
expression, which is given below.
𝑍= 𝐴‾
The bar over the input variable A represents the inversion operation.
Truth Table of OR Gate:
The truth table describes the relationship between input and output. The
following is the truth table for the NOT gate:
Input Output
A NOT A
0 1
1 0
NOR Gate
The NOR gate is a type of universal logic gate that can take two or more
inputs but one output. It is basically a combination of two basic logic
gates i.e., OR gate and NOT gate. Thus, it can be expressed as,
NOR Gate = OR Gate + NOT Gate
In other words, a NOR gate is an OR gate followed by a NOT gate.
A B A NOR B
0 0 1
0 1 0
1 0 0
1 1 0
NAND Gate
In digital electronics, the NAND gate is another type of universal logic
gate used to perform logical operations. The NAND gate performs the
inverted operation of the AND gate. Similar to NOR gate, the NAND gate
can also have two or more input lines but only one output line.
The NAND gate is also represented as a combination of two basic logic
gates namely, AND gate and NOT gate. Hence, it can be expressed as
NAND Gate = AND Gate + NOT Gate
We can describe the expression of NAND gate through a mathematical
equation called its boolean expression. Here is the boolean expression of
a two input NAND gate.
𝐶=𝐴𝐵‾C=AB
In this expression, A and B are the input variables and C is the output
variable. We can extend this relation to any number of input variables like
three, four, or more.
Truth Table of NAND Gate:
The truth table is a table of inputs and output that describes the
operation of the NAND gate and shows the logical relationship between
them:
Input Output
A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0
XOR Gate
In digital electronics, there is a specially designed logic gate named, XOR
gate, which is used in digital circuits to perform modulo sum. It is also
referred to as Exclusive OR gate or Ex-OR gate. The XOR gate can take
only two inputs at a time and give an output. The output of the XOR gate
is high or logic 1 only when its two inputs are dissimilar.
The operation of the XOR gate can be described through a mathematical
equation called its boolean expression. The following is the boolean
expression for the output of the XOR gate.
𝑍=𝐴⊕𝐵Z=A⊕B
Here, Z is the output variable, and A and B are the input variables.
This expression can also be written as follows:
𝑍=𝐴𝐵‾+𝐴‾𝐵Z=AB+AB
Truth Table of XOR Gate:
The truth table is a table of inputs and output that describe the
relationship between them and the operation of the XOR gate for
different input combinations. The truth table of the XOR gate is given
below:
Input Output
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
XNOR Gate
The XNOR gate is another type of special purpose logic gate used to
implement exclusive operation in digital circuits. It is used to implement
the Exclusive NOR operation in digital circuits. It is also called the Ex-
NOR or Exclusive NOR gate. It is a combination of two logic gates
namely, XOR gate and NOT gate. Thus, it can be expressed as,
XNOR Gate = XOR Gate + NOT Gate
The output of an XNOR gate is high or logic 1 when its both inputs are
similar. Otherwise the output is low or logic 0. Hence, the XNOR gate is
used as a similarity detector circuit.
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1