logic gates

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

Digital electronic circuits operate with voltages of two logic levels namely Logic Low

and Logic High. The range of voltages corresponding to Logic Low is represented with
‘0’. Similarly, the range of voltages corresponding to Logic High is represented with ‘1’.
The basic digital electronic circuit that has one or more inputs and single output is
known as Logic gate. Hence, the Logic gates are the building blocks of any digital
system. We can classify these Logic gates into the following three categories.

 Basic gates
 Universal gates
 Special gates
Now, let us discuss about the Logic gates come under each category one by one.

Basic Gates
In earlier chapters, we learnt that the Boolean functions can be represented either in
sum of products form or in product of sums form based on the requirement. So, we can
implement these Boolean functions by using basic gates. The basic gates are AND, OR
& NOT gates.
AND gate
An AND gate is a digital circuit that has two or more inputs and produces an output,
which is the logical AND of all those inputs. It is optional to represent the Logical
AND with the symbol ‘.’.
The following table shows the truth table of 2-input AND gate.

A B Y = A.B

0 0 0

0 1 0

1 0 0

1 1 1

Here A, B are the inputs and Y is the output of two input AND gate. If both inputs are ‘1’,
then only the output, Y is ‘1’. For remaining combinations of inputs, the output, Y is ‘0’.
The following figure shows the symbol of an AND gate, which is having two inputs A, B
and one output, Y.
This AND gate produces an output Y�, which is the logical AND of two inputs A, B.
Similarly, if there are ‘n’ inputs, then the AND gate produces an output, which is the
logical AND of all those inputs. That means, the output of AND gate will be ‘1’, when all
the inputs are ‘1’.
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.

A B Y=A+B

0 0 0

0 1 1

1 0 1

1 1 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’.
The following figure shows the symbol of an OR gate, which is having two inputs A, B
and one output, Y.
This OR gate produces an output Y�, which is the logical OR of two inputs A, B.
Similarly, if there are ‘n’ inputs, then the OR gate produces an output, which is the
logical OR of all those inputs. That means, the output of an OR gate will be ‘1’, when at
least one of those inputs is ‘1’.
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.

A Y = A’

0 1

1 0

Here A and Y are the input and output of NOT gate respectively. If the input, A is ‘0’,
then the output, Y is ‘1’. Similarly, if the input, A is ‘1’, then the output, Y is ‘0’.
The following figure shows the symbol of NOT gate, which is having one input, A and
one output, Y.

This NOT gate produces an output Y�, which is the complement of input, A.

Universal gates
NAND & NOR gates are called as universal gates. Because we can implement any
Boolean function, which is in sum of products form by using NAND gates alone.
Similarly, we can implement any Boolean function, which is in product of sums form by
using NOR gates alone.
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.
A B Y = A.B�.�’

0 0 1

0 1 1

1 0 1

1 1 0

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.
The following image shows the symbol of NAND gate, which is having two inputs A, B
and one output, Y.

NAND gate operation is same as that of AND gate followed by an inverter. That’s why
the NAND gate symbol is represented like that.
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

A B Y = A+B�+�’

0 0 1

0 1 0

1 0 0
1 1 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.
The following figure shows the symbol of NOR gate, which is having two inputs A, B
and one output, Y.

NOR gate operation is same as that of OR gate followed by an inverter. That’s why the
NOR gate symbol is represented like that.

Special Gates
Ex-OR & Ex-NOR gates are called as special gates. Because, these two gates are
special cases of OR & NOR gates.
Ex-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.

A B Y = A⊕B

0 0 0

0 1 1

1 0 1

1 1 0

Here A, B are the inputs and Y is the output of two input Ex-OR gate. The truth table of
Ex-OR gate is same as that of OR gate for first three rows. The only modification is in
the fourth row. That means, 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.
Below figure shows the symbol of Ex-OR gate, which is having two inputs A, B and one
output, Y.

Ex-OR gate operation is similar to that of OR gate, except for few combination s� of
inputs. That’s why the Ex-OR gate symbol is represented like that. The output of Ex-OR
gate is ‘1’, when odd number of ones present at the inputs. Hence, the output of Ex-OR
gate is also called as an odd function.
Ex-NOR gate
The full form of Ex-NOR gate is Exclusive-NOR gate. Its function is same as that of
NOR gate except for some cases, when the inputs having even number of ones.
The following table shows the truth table of 2-input Ex-NOR gate.

A B Y = A⊙B

0 0 1

0 1 0

1 0 0

1 1 1

Here A, B are the inputs and Y is the output. The truth table of Ex-NOR gate is same as
that of NOR gate for first three rows. The only modification is in the fourth row. That
means, the output is one instead of zero, when both the inputs are one.
Therefore, the output of Ex-NOR gate is ‘1’, when both inputs are same. And it is zero,
when both the inputs are different.
The following figure shows the symbol of Ex-NOR gate, which is having two inputs A, B
and one output, Y.
Ex-NOR gate operation is similar to that of NOR gate, except for few combination s� of
inputs. That’s why the Ex-NOR gate symbol is represented like that. The output of Ex-
NOR gate is ‘1’, when even number of ones present at the inputs. Hence, the output of
Ex-NOR gate is also called as an even function.
From the above truth tables of Ex-OR & Ex-NOR logic gates, we can easily notice that
the Ex-NOR operation is just the logical inversion of Ex-OR operation.

A Boolean function is a logical expression that returns a Boolean value, which is a


value that is either TRUE or FALSE. In digital electronic circuits, the logic gates are
used to implement a conditional or logical or Boolean expressions.
A logic gate is a digital circuit that performs a specific logical operation on one or more
input variables or signals and generates an output signal. The output of a logic gate is
determined by its logical function, which is based on Boolean algebra.
In digital electronics, there are several types of logic gates available such as AND gate,
OR gate, NOT gate, NAND gate, NOR gate, XOR gate, XNOR gate, etc. we may use
these logic gates to implement different types of Boolean functions.
Before going into the implementation of a Boolean function using logic gates, let's have
a look into the basic introduction of different logic gates first.

What is an OR Gate?
An OR Gate is a basic logic gate. An OR gate may accept two or more than two inputs,
but gives only one output. The OR gate gives a HIGH (Logic 1) output if any one of its
inputs is in the HIGH or Logic 1 state, otherwise, it gives a LOW (Logic 0) state as
output. Therefore, the output of the OR gate is LOW or Logic 0 state, only if all its
inputs are LOW or Logic 0 state. The logic symbol of the OR gate is shown in Figure-1.

The expression of the output of the OR gate is given by,


Y=A+B+C+⋅⋅⋅Y=A+B+C+⋅⋅⋅
Where, A, B, C, … are the input variables and Y is the output variable of the OR gate.
The '+' symbol represents the OR operation.

What is an AND Gate?


An AND Gate is a basic logic gate. An AND gate may have two or more than two
inputs, but gives only one output. The AND gate gives a LOW (Logic 0) output if any
one of its inputs is in the LOW or Logic 0 state, otherwise, it gives a HIGH (Logic 1)
state as output. Therefore, the output of the AND gate is HIGH or Logic 1 state, only if
all its inputs are HIGH or Logic 1 state. The logic symbol of the AND gate is shown in
Figure-2.

The expression of the output of the AND gate is given by


Y=A⋅B⋅C...Y=A⋅B⋅C...
Where, the dot (.) symbol represents the AND operation.

What is a NOT Gate?


A NOT gate is a basic logic gate that has only one input and one output. It is type of
logic gate whose output is always the complement of its input. Therefore, the NOT gate
is also known as an inverter.
If the input of the NOT gate is LOW (or Logic 0), then it produces an output that is
HIGH (Logic 1). If the input is HIGH (or Logic 1), then the NOT gate produces the LOW
(Logic 0) output. The logic symbol of the NOT gate is shown in Figure-3.

The expression for the output of the NOT gate is given by,
Y=A¯=A′Y=A¯=A′
Where, the bar (-) over the input variable represents the NOT operation.
Now, let us understand the implementation of Boolean functions using logic gates.
Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses only
the binary numbers i.e. 0 and 1. It is also called as Binary Algebra or logical Algebra.
Boolean algebra was invented by George Boole in 1854.

Rule in Boolean Algebra


Following are the important rules used in Boolean algebra.
 Variable used can have only two values. Binary 1 for HIGH and Binary 0 for LOW.
 Complement of a variable is represented by an overbar (-). Thus, complement of
variable B is represented as . Thus if B = 0 then = 1 and B = 1 then = 0.
 ORing of the variables is represented by a plus (+) sign between them. For
example ORing of A, B, C is represented as A + B + C.
 Logical ANDing of the two or more variable is represented by writing a dot
between them such as A.B.C. Sometime the dot may be omitted like ABC.

Boolean Laws
There are six types of Boolean Laws.
Commutative law
Any binary operation which satisfies the following expression is referred to as
commutative operation.

Commutative law states that changing the sequence of the variables does not have any
effect on the output of a logic circuit.
Associative law
This law states that the order in which the logic operations are performed is irrelevant as
their effect is the same.

Distributive law
Distributive law states the following condition.

AND law
These laws use the AND operation. Therefore they are called as AND laws.
OR law
These laws use the OR operation. Therefore they are called as OR laws.

INVERSION law
This law uses the NOT operation. The inversion law states that double inversion of a
variable results in the original variable itself.

Important Boolean Theorems


Following are few important boolean Theorems.

Implementation of Boolean Functions using Logic Gates


In this section, we will study the implementation of any type of Boolean function using
logic gates. The easiest method to implement a Boolean function to a logic circuit is to
start with the output and then work towards the inputs. Now, let us understand the
complement processes through examples.

Implementation of Two Variable Boolean Function


Consider a Boolean function of two variables,
F=AB¯+AB
We have to implement this Boolean function using logic gates.
For implementing this Boolean function start with the final expression AB'+AB. Since, it
is a summation of two terms, thus it must be the output of a two-input OR gate. So draw
an OR gate with two inputs as shown in Figure-4.
Now, the term AB' is the output of a two input AND gate whose inputs are A and B'.
Where, B' is in turn output of a NOT gate whose input is B. The term AB is the output of
a two input AND gate whose inputs are A and B. Hence, the logic circuit will become as
shown in Figure-5.

Now, AB must be the output of a two-input AND gate whose inputs are A and B. And B
+ C must be the output of a two input OR gate whose inputs are B and C. So, we
introduce an AND gate and an OR gate in the logic circuit as shown in Figure-8.

This is the complete implementation of the given Boolean function using logic gates.
Hence, in this way, we can implement any Boolean function of any number of variables
using logic gates.
Examples of Boolean algebra
simplifications using logic gates
In this section, we will look at some of the examples of Boolean algebra simplification
using Logic gates.

1. F1 = xyz'

2. F2 = x + y'z

3. F3 = xy' + x'z

Play Video
4. F4 = x'y'z + x'yz + xy'

Boolean algebra laws and theorems are a set of rules that are required to reduce or simplify any
given complex Boolean expression. Follwing is a list of Boolean algebra laws that are most
commonly used.

Boolean laws Description

 A.0=0
Annulment law
 A+1=1

Identity law  A.1=A


 A+0=A

 A.A=A
Idempotent law
 A+A=A

 A . AC = 0
Complement law
 A + AC = 1

 A.B=B.A
Commutative Law
 A+B=B+A

 A . (B . C) = (A . B) . C
Associative law
 A + (B + C) = (A + B) + C

 A(B + C) = AB + AC
Distributive law
 A + (BC) = (A + B)(A + C)

 A.(A + B) = A
Absorption law
 A + (A . B) = A

Involution law  (A’)’ = A

 (A + B)C = AC . BC
De Morgan’s law
 (A . B)C = AC + BC

De Morgan has suggested two theorems which are extremely useful in Boolean
Algebra. The two theorems are discussed below.

Theorem 1

 The left hand side (LHS) of this theorem represents a NAND gate with inputs A
and B, whereas the right hand side (RHS) of the theorem represents an OR gate
with inverted inputs.
 This OR gate is called as Bubbled OR.
Table showing verification of the De Morgan's first theorem −

Theorem 2

 The LHS of this theorem represents a NOR gate with inputs A and B, whereas
the RHS represents an AND gate with inverted inputs.
 This AND gate is called as Bubbled AND.
Table showing verification of the De Morgan's second theorem −

You might also like