This document defines and describes basic digital logic gates. It states that logic gates are the basic building blocks of digital circuits and have inputs that are either 0 or 1. The document then explains the functionality and truth tables of common logic gates including OR, AND, NOT, NAND, NOR, XOR, and XNOR gates. It provides the symbol, description of output conditions, and truth table for each gate type.
Introduction to ArtificiaI Intelligence in Higher Education
Logic gates
1. CH= 02
LOGIC GATES
By: Saeed Ullah Jan
(PhD – Scholar University of Malakand)
Lecturer in Computer Science
Govt Degree College Wari (Dir Upper)
Email: saeedullah@uom.edu.pk // saeedjan03@gmail.com
Phone: 0944-840488
Course Title: Digital Logic & Computer Design
Program: BS – Computer Science 3rd Semester
13-Nov-18
2. Definition
• Digital logic is the representation of electrical
signals and sequences of digital circuit through
numbers.
• Signal or Input will be 0 or 1
• Inputs may be one, two or more
• Implementation of Number Systems
• Basic Concept
• Logic Gates
13-Nov-18
3. Logic Gates
• A logic gate is an elementary building block of a digital circuit.
• Most logic gates have two inputs and one output.
• At any given moment, every terminal is in one of the two binary
conditions low (0) or high (1), represented by different voltage
levels.
13-Nov-18
4. What are the basic digital logic gates ?
• Digital systems are said to be constructed by
using logic gates.
• These gates are the AND, OR, NOT, NAND, NOR,
XOR and XNOR gates.
• The basic operations are described below with the
help of truth tables.
13-Nov-18
5. OR Gate:
• The OR gate is an electronic circuit that gives a high output (1) if
one or more of its inputs are high
• An OR gate is a digital logic gate with two or more inputs and one
output that performs logical operation. The output of an OR gate is
true when one or more of its inputs are true
• Truth Table
Symbol
OR
13-Nov-18
X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
X
Y
Z
Z = X | Y
6. AND Gate:
• The AND gate is an electronic circuit that gives a high output
(1) only if all of its inputs are high
• An AND gate is a digital logic gate with two or more inputs and
one output that performs logical operation. The output of an
AND gate is true when both or all of its inputs are true
• Truth Table
Symbol
13-Nov-18
X Y Z
0 0 0
0 1 0
1 0 0
1 1 1
AND
Z = X & Y
X
Y
Z
7. NOT Gate:
• The NOT gate is an electronic circuit that gives a high output
(1) if input is low (0) and gives low (0) output if input is high (1).
• It simply invert the input
• Truth Table
Symbol
13-Nov-18
X Y
0
1
1
0
X Y
Y
NOT
X Y
Y = ~X
NOT
8. NAND Gate:
• A NAND gate is a logic gate which produces an output which is
false only if all its inputs are true
• Its output is complement of an AND gate
• Truth Table
Symbol
13-Nov-18
X Y Z
0 0 1
0 1 1
1 0 1
1 1 0
NAND
X
Y
Z
Z = ~(X & Y)
nand(Z,X,Y)
9. NOR Gate:
• The NOR gate is a digital logic gate that produces logical high
output if both the inputs to the gate are low
• Its output is complement of an OR gate
• Truth Table
Symbol
13-Nov-18
X Y Z
0 0 1
0 1 0
1 0 0
1 1 0
X
Y
Z
Z = ~(X | Y)
nor(Z,X,Y)
10. Exclusive-OR or XOR Gate:
• The XOR gate is a digital logic gate that gives a true output
when the number of true inputs is odd
• When inputs are same the output low
• When inputs are different the output high
• Truth Table
Symbol
13-Nov-18
X Y Z
0 0 0
0 1 1
1 0 1
1 1 0
XOR
X
Y
Z
Z = X ^ Y
XOR(Z,X,Y)
11. XNOR or Exclusive-NOR Gate:
• The XNOR gate is a digital logic gate whose function is the
logical complement of the exclusive OR gate
• The output of an XNOR gate is true when all of its inputs are
true or when all of its inputs are false.
• Truth Table
Symbol
13-Nov-18
X Y Z
0 0 1
0 1 0
1 0 0
1 1 1
XNOR
X
Y
Z
Z = ~(X ^ Y)
Z = X ~^ Y
XNOR(Z,X,Y)