Transcript Logic Gate

Lecture 3
Introduction to Digital Logic
1
What is logic gate?
 Logic gates are the building blocks of digital circuits.
 Combinations of logic gates form circuits designed
with specific tasks in mind.
 For example, logic gates are combined to form
circuits to add binary numbers (adders), set and reset
bits of memory (flip flops), multiplex multiple inputs,
etc.
2
Logic Gates
AND Gate
OR Gate
XOR Gate
NOT Gate
NAND Gate
NOR Gate
3
Logic Gate - AND
AND Gate (similar to ‘ * ‘)
x, y are input, which are either TRUE (i.e. 1)
or FALSE (i.e. 0).
x
y
output
0
0
0
0
1
0
1
0
0
1
1
1
4
Logic Gate - OR
OR Gate ( similar to ‘ + ‘)
x
0
0
1
1
y
0
1
0
1
output
0
1
1
1
5
Logic Gate - NOT
NOT Gate (Negated)
Opposite to the input (or invert the input as the
output)
x
output
0
1
1
0
6
Logic Gate - XOR
XOR Gate (Exclusive OR)
Same as OR gate except when both input are 1,
the output is 0.
x
y
output
0
0
0
0
1
1
1
0
1
1
1
0
7
Logic Gate - NAND
NAND Gate (NOT + AND = NAND)
With same input as AND gate but the output is
negated.
x
y
output
0
0
1
0
1
1
1
0
1
1
1
0
This circle means negated.
8
Logic Gate - NOR
NOR Gate (NOT + OR = NOR)
The same input as OR gate but the output is
negated.
x
y
output
0
0
1
0
1
0
1
0
0
1
1
0
Negated
9
Evaluate output of a simple logic circuit
Consider
A
D
E
B
Output
C
10
What is the final output?
A
0
0
1
1
B
0
1
0
1
(A OR B)
(A AND B)
NOT D (C AND E)
C
0
1
1
1
D
0
0
0
1
E
1
1
1
0
output
0
1
1
0
Is it same as XOR ?
All possible combination of A and B
11
Number of Possible Combination
 Number of Possible Combination = 2n
where n is the number of input
Example
Number of Input
1
2
3
4
5
.
Possible Combination
2
4
8
16
32
….
12
How to find out the possible combinations
Example – Take n = 3 (inputs – A, B and C)
Possible combinations = 23 = 8
A
B
C
A
B
C
0
0
0
1
0
0
0
0
1
1
0
1
0
1
0
1
1
0
0
1
1
1
1
0
Observe the pattern for listing the combination!
13
Exercise
 Evaluate the following logic circuit
A
B
output
C
14
Exercise
 By using AND, NOT, OR gates, design a digital
circuit with same truth table as XOR gate.
15
Logic Gate – What you can find in electronic components
market.
16
Integrated Circuits (IC)
data sheet
17
An SSI chip contains independent NAND gates
Integrated Circuits (IC)
12
13
[1]
1
2
[2]
[3]
8
[2]
[1]
[3]
Multiple chips (gates) combined to a circuit to solve a specific problem
18
CPU Chips
The most important integrated circuit (IC) in any
computer is the Central Processing Unit, or CPU.
19