You are on page 1of 34

Logic gates

Logic gates and Logic circuits


A logic gate is a building block of a
digital circuit. 
Gate is an electronic circuit with one or more
inputs but only one output.
Any logic circuit can be implemented using only
the three basic gates namely AND , OR and NOT.
To make the implementation easier, other gates
were developed.
NOT gate or Inverter
• The NOT gate has only one input and one
output.
• When the input is LOW (0) the output is HIGH
(1)
• When the input is HIGH, the output is LOW
• That is the output is the complement or
inverse of the input.
Note: The small circle at the end of the triangle
indicates inversion.
If the small circle is removed , the gate is called as
the buffer.
For the buffer, the output
is equal to the input
OR gate
• An OR gate performs logical addition. An OR
gate has 2 or more inputs and one output.
• If any input signal is HIGH, the output signal
goes HIGH.
• The output is LOW only when all the inputs
are LOW
2-input OR gate
A 3 input OR gate has 3 inputs and one
output
AND gate
• An AND gate performs logical multiplication.
An AND gate has 2 or more inputs and one
output.
• If any input signal is LOW, the output signal
goes LOW.
• The output is HIGH only when all the inputs
are HIGH
Graphical symbol , truth table and algebraic
function of AND gate
A 3 input AND gate has 3 inputs and one
output
NAND gate
• It is the combination of AND and NOT gates. It
is a complement of AND function.
• It has two or more inputs and only one output
• This gate produces output 0 when all the
inputs are 1, otherwise output will be 1
Graphical symbol , truth table and algebraic
function of NAND gate
NOR gate
• It is the combination of OR and NOT gates. It is
a complement of OR function.
• It has two or more inputs and only one output
• This gate produces output 1 when all the
inputs are 0, otherwise output will be 1
Graphical symbol , truth table and algebraic
function of NOR gate
Exclusive OR/ XOR/Ex-OR GATE
• In a 2-input Exclusive OR ( XOR), the output is
HIGH (1) when one of the inputs is HIGH (1)
Graphical symbol , truth table and algebraic
function of XORgate
•  

Y = B + A also
Exclusive NOR/ XNOR/Ex-NOR GATE

• It is equivalent to Ex-OR gate followed by an


inverter(NOT) gate
Graphical symbol , truth table and algebraic
function of XNORgate
•  

• Y= +AB
Universal gates
• A universal logic gate is used to construct all other
logic gates.
• There are only two universal gates 
1)The NAND gate
2) NOR  gate. 

• Universal gates are the logic gates which are


capable of implementing any Boolean function
without requiring any other type of gate.
NAND as universal gate
• NAND Gate = AND Gate + NOT Gate
• The functions of NOT, AND , OR etc., can be
implemented using only NAND gates.
• Therefore NAND gate is called as a universal
gate or universal building block
NAND as NOT
• The
  NOT gate has only one input and one
output. If the input is A the output is given by .
The symbol is
A Y=  𝐴

TRUTH TABLE
A
A Y=
0 1
0 1
1 1
1 1
• In
  a two input NAND gate, if both the inputs are
marked as A, then the output is given by .
• Since the two inputs are the same , the two inputs
of the NAND gate can be connected together and
used as a gate with a single input. This
arrangement makes the NAND to function as NOT

A Y= 𝐴.𝐴
 
=
 
𝐴
A Y=  
𝐴
• Note: A three input, four input or eight input
NAND gate can also be converted into a NOT
gate by connecting all inputs together.
NAND as AND
• We know that the symbol ,truth table and
algebraic expression of AND gate are
• The
  output of the NAND gate is.
• To make it as AB , the output of the NAND
gate is inverted once. This inverter is
implemented by using a second NAND gate.

A 𝐴𝐵
 
Y= 𝐴𝐵 =AB
 

A 𝐴𝐵
 
Y= 𝐴𝐵 =AB
 

B
NOTE : A three input AND gate can be implemented using a three input
NAND gate
NAND as OR
• We know that the symbol, algebraic
expression and truth table of OR gate are
• To get the OR expression A+B, the inputs are first
inverted and then passed through a NAND gate.
This arrangement is shown in the following figure.
Three NAND gates are needed to get the OR
function.
 
𝐴
A
Y= 𝐴. =
     
𝐴 +𝐵
 
=
𝐵
 
A+ B
B
By De Morgan’s law
NOR as universal gate
• We know that graphical symbol , truth table
and algebraic function of NOR gate are
NOR as NOT
• In a two input NOR gate, if both the inputs are
marked as A, then the output is given by 𝐴+𝐴 

which is equal to 𝐴
 

Since the two inputs are the same, the two


inputs of the NOR gate can be connected
together and used as a gate with a single input.
This arrangement makes the NOR to function as
NOT.
Y=𝐴+𝐴 
=  
𝐴

Y=
NOR as OR
• The output of the NOR gate is 𝐴+𝐵  

• To make it A + B , the output of the NOR gate


is inverted once.
• But the inverter is also implemented using a
second NOR gate.
Y= 𝐴+𝐵
𝑨+𝑩
   
A =A + B
B

𝑨+𝑩
  Y= 𝐴+𝐵
 
=A + B
A
B
NOR as AND
• To get the AND expression A . B , the inputs
are first inverted and then passed through a
NOR gate.
• This arrangement is shown below. Three NOR
gates are needed to get the AND function.
A  
𝐴
Y= 𝐴+𝐵=
     
𝐴 .𝐵
 
=
A.B
B 𝐵
 
By De Morgan’s law

You might also like