2. Chapter 3 - Basic Logic Gates
Lesson Objectives
Upon completion of this topic, you should be able to:
Relate the operation of basic logic gates such as AND,
OR, NOT, NAND, NOR, EX-OR and EX-NOR, and
construct its truth table.
IT2001PA Engineering Essentials (2/2) 2
3. Chapter 3 - Basic Logic Gates
Specific Objectives
Students should be able to :
Explain the use of logic gate.
Describe the function of the basic logic gates (i.e. NOT, AND,
NAND, OR, NOR, EX-OR and EX-NOR) with the help of symbol,
truth table and its equivalent switching circuit.
Describe how NOT, AND, OR, NOR can be constructed from
NAND gates.
Describe how NOT, AND, OR, NOR can be constructed from
NOR gates.
IT2001PA Engineering Essentials (2/2)
4. Chapter 3 - Basic Logic Gates
Logic Gates
In digital logic system, events are described
as either ‘0’ or ‘1’
Logic 1 Logic 0
Switch ON Switch OFF
Bulb lights up Bulb unlighted
High Low
True False
5 volts 0 volts
2.4V to 5V 0V to 0.4V
IT2001PA Engineering Essentials (2/2) 4
5. Chapter 3 - Basic Logic Gates
Logic Gates
Positive Logic
In a positive logic system, a high voltage is used to represent logical
true(1), and a low voltage for logical false (0).
In positive logic circuits it is normal to use +5V for true and
0V for false.
Negative Logic
In a negative logic system, a low voltage is used to represent
logical true (1) and a high voltage for a logical false (0).
IT2001PA Engineering Essentials (2/2) 5
6. Chapter 3 - Basic Logic Gates
Gate
- it has 2 or more binary inputs and 1 output
Binary Binary
Inputs
Gate Output
IT2001PA Engineering Essentials (2/2) 6
7. Chapter 3 - Basic Logic Gates
7 Basic Logic Gates
AND gate
OR gate
INVERTER ( NOT ) gate
NAND gate
NOR gate
XOR gate
XNOR gate
IT2001PA Engineering Essentials (2/2) 7
8. Chapter 3 - Basic Logic Gates
Truth Table
Table which relates the output of a logic function to all
the possible combinations of the inputs.
The number of possible combinations of the inputs is
equal to 2N, where N is the number of inputs
A logic gate with 2 inputs 22= 4 possible combinations from its inputs
Inputs Output
0 0 Depends on the logic function
0 1 Depends on the logic function
1 0 Depends on the logic function
1 1 Depends on the logic function
IT2001PA Engineering Essentials (2/2) 8
9. Chapter 3 - Basic Logic Gates
The AND Operation
A B
L=A.B
Lamp: Off=0 Switch: Open=0
ON=1 Closed=1
IT2001PA Engineering Essentials (2/2) 9
10. Chapter 3 - Basic Logic Gates
Truth Table of AND Gate
A B L
Lamp : Off = 0
0 0 0 On = 1
0 1 0
1 0 0 Switch : Open =0
Closed=1
1 1 1
IT2001PA Engineering Essentials (2/2) 10
11. Chapter 3 - Basic Logic Gates
The AND Gate
Symbol
A
B Y=A.B.C
C
Equation : Y = A.B.C
IT2001PA Engineering Essentials (2/2) 11
12. Chapter 3 - Basic Logic Gates
Summary of AND Gate
The AND gate produces a HIGH output only when all
of the inputs are HIGH
1
1
1
When any of the inputs is LOW, the output is LOW
0 1 0
0 0 0
1 0 0
IT2001PA Engineering Essentials (2/2) 12
13. Chapter 3 - Basic Logic Gates
Truth Table of AND Gate
A B C L
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1 Output = 1 only
1 1 1 1 if all inputs are 1
IT2001PA Engineering Essentials (2/2) 13
14. Chapter 3 - Basic Logic Gates
Example
Determine the output waveform for the AND gate shown.
A 0 1 0 0 1 0 A
Y
B 0 0 0 1 0 B
1
Y 0 0 0 0 0
1
IT2001PA Engineering Essentials (2/2) 14
15. Chapter 3 - Basic Logic Gates
The OR Operation
A
B
Lamp: OFF= 0 Switch: Open=0
ON=1 Closed=1
IT2001PA Engineering Essentials (2/2) 15
16. Chapter 3 - Basic Logic Gates
Truth Table of OR Gate
A B L
Lamp : OFF =0
0 0 0 ON=1
0 1 1
1 0 1 Switch : Open=0
Closed=1
1 1 1
IT2001PA Engineering Essentials (2/2) 16
17. Chapter 3 - Basic Logic Gates
The OR Gate
Symbol
A
B Y
C
Equation : Y = A + B + C
IT2001PA Engineering Essentials (2/2) 17
18. Chapter 3 - Basic Logic Gates
Summary of OR Gate
The output is LOW only when all the inputs are LOW
0
0
0
The OR gate produces a HIGH on the output when any of
the inputs is HIGH
1 0 1
1 1 1
0 1 1
IT2001PA Engineering Essentials (2/2) 18
19. Chapter 3 - Basic Logic Gates
Truth Table of OR Gate
A B C L
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
Output = 1 only if
1 1 1 1 any of inputs is 1
IT2001PA Engineering Essentials (2/2) 19
20. Chapter 3 - Basic Logic Gates
Example
Draw the output waveform for the OR gate
A
A0 1 0 1 0 Y
B
B 0 1 1 0 0
Y 0
1 1 1 0
IT2001PA Engineering Essentials (2/2) 20
21. Chapter 3 - Basic Logic Gates
The NOT Operation (Inverter)
Symbol
A A
A A
Equation
Y = A
IT2001PA Engineering Essentials (2/2) 21
22. Chapter 3 - Basic Logic Gates
Truth Table of Inverter
Inputs Output
0 1
1 0
Its logic output is always the inverse of the logic inputs
IT2001PA Engineering Essentials (2/2) 22
23. Chapter 3 - Basic Logic Gates
NAND Gate
A A
X=AB X=AB
B B
Equation
X= AB
X= AB
IT2001PA Engineering Essentials (2/2) 23
24. Chapter 3 - Basic Logic Gates
Truth Table of NAND Gate
Inputs AND NAND
A B AB AB
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0
IT2001PA Engineering Essentials (2/2) 24
25. Chapter 3 - Basic Logic Gates
Summary of NAND Gate
The NAND gate produces a LOW output only when all
the inputs are HIGH
1
0
1
When any of the inputs is LOW , the output will be HIGH
0 1 0
1 1 1
1 0 0
IT2001PA Engineering Essentials (2/2) 25
26. Chapter 3 - Basic Logic Gates
Example
Draw the output waveform for the NAND gate shown
0 0
A 0 1 1 A
Y
B
0 0
1 1 1
B
Y 1 1
IT2001PA Engineering Essentials (2/2) 26
27. Chapter 3 - Basic Logic Gates
NOR Gate
A A
X=A+B
X=A+B B
B
Equation
X= A+B
X= A+B
IT2001PA Engineering Essentials (2/2) 27
28. Chapter 3 - Basic Logic Gates
Truth Table of NOR Gate
Inputs OR NOR
A B A+B A+B
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0
IT2001PA Engineering Essentials (2/2) 28
29. Chapter 3 - Basic Logic Gates
Summary of NOR Gate
The NOR gate produces a HIGH output only when all
the inputs are LOW
0
1
0
When any of the inputs is HIGH , the output will be LOW
0 1 1
0 0 0
1 0 1
IT2001PA Engineering Essentials (2/2) 29
30. Chapter 3 - Basic Logic Gates
Example
Draw the output waveform for the NOR gate shown
A 0 1 0 1 0 1 A
Y
B
1 1 0 1 0 0
B
Y 0 0 1 0 0
1
IT2001PA Engineering Essentials (2/2) 30
32. Chapter 3 - Basic Logic Gates
EX-OR Gate
Truth Table
A B Y
A
0 0 0
X = A ⊕B
B 0 1 1
1 0 1
1 1 0
Logic Equation
X = AB + A B Its output is High only when the
X = A⊕B inputs are at different levels.
IT2001PA Engineering Essentials (2/2) 32
33. Chapter 3 - Basic Logic Gates
EX-NOR Gate
Truth Table
A A B Y
X = A⊕B 0 0 1
B
0 1 0
1 0 0
1 1 1
Logic Equation
X = A B + AB Its output is High only when the inputs are
X = A⊕B at the same levels.
IT2001PA Engineering Essentials (2/2) 33
34. Chapter 3 - Basic Logic Gates
Exercise on Timing Diagram
Draw the output waveform X of the EX-OR gate with inputs
A and B given below:
A
X
B
A
B
X
IT2001PA Engineering Essentials (2/2) 34
35. Chapter 3 - Basic Logic Gates
Exercise on Timing Diagram
Draw the output waveform X of the EX-NOR gate with inputs A
and B given below:
A
X
B A
B
X
IT2001PA Engineering Essentials (2/2) 35