Lec-5 Basic Logic Gates
Lec-5 Basic Logic Gates
Lec-5 Basic Logic Gates
NOT X Y
X Y 0 1
1 0
Y = ~X
NOT
X ~X ~~X = X
X ~X ~~X
0 1 0
1 0 1
AND Gate
AND
X Y Z
X 0 0 0
0 1 0
Z
1 0 0
Y 1 1 1
Z = X & Y
OR Gate
OR
X Y Z
X 0 0 0
Z 0 1 1
Y 1 0 1
1 1 1
Z = X | Y
Basic Logic Gates
and Basic Digital Design
• NOT, AND, and OR Gates
• NAND and NOR Gates
• DeMorgan’s Theorem
• Multiple-input Gates
NAND Gate
NAND
X Y Z
X 0 0 1
0 1 1
Z
1 0 1
Y 1 1 0
Z = ~(X & Y)
nand(Z,X,Y)
NOR Gate
NOR
X Y Z
X 0 0 1
Z 0 1 0
Y 1 0 0
1 1 0
Z = ~(X | Y)
nor(Z,X,Y)
Basic Logic Gates
and Basic Digital Design
• NOT, AND, and OR Gates
• NAND and NOR Gates
• DeMorgan’s Theorem
• Multiple-input Gates
DeMorgan’s Theorem
X Z X Z
=
Y Y
Z = ~(X & Y) Z = ~X | ~Y
X Y W Z X Y ~X ~Y Z
0 0 0 1 0 0 1 1 1
0 1 0 1 0 1 1 0 1
1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 0 0 0
De Morgan’s Theorem-1
~(X & Y) = ~X | ~Y
• NOT all variables
• Change & to | and | to &
• NOT the result
NOR Gate
X X
Z Z
Y Y
Z = ~(X | Y) Z = ~X & ~Y
X Y Z X Y ~X ~Y Z
0 0 1 0 0 1 1 1
0 1 0 0 1 1 0 0
1 0 0 1 0 0 1 0
1 1 0 1 1 0 0 0
De Morgan’s Theorem-2
~(X | Y) = ~X & ~Y
• NOT all variables
• Change & to | and | to &
• NOT the result
Basic Logic Gates
and Basic Digital Design
• NOT, AND, and OR Gates
• NAND and NOR Gates
• DeMorgan’s Theorem
• Multiple-input Gates
Multiple-input Gates
Z1 Z2
Z3 Z4
Multiple-input AND Gate
Z1
Z2
Z3
Z4