Logic Gates
Logic Gates
EEE221
Basic Electronics
Dr. Enesi A. Y, Engr. Nwozor E and Engr. Isiyaku S
1
ON or OFF- indications
• ON or TRUE is indicated as 1
• OFF or FALSE is indicated as 0
2
Introduction using series connection of switches
(AND gate)
A B OUTPUT
0 0 0 3
Introduction cont’
A B OUTPUT
1 0 0 4
Introduction cont’
A B OUTPUT
0 1 0 5
Introduction cont’
A A OUTPUT
1 1 1 6
Introduction using parallel connection
of switches (OR gate)
A B OUTPUT
0 0 0 7
Introduction cont’
A B OUTPUT
1 0 1 8
Introduction cont’
A B OUTPUT
0 1 1 9
Introduction cont’
A B OUTPUT
1 1 1 10
Basic logic gates
• Not x
x
x xy x xyz
• And y y
z
x x+y x x+y+z
• Or y
y
z
x xy
• Nand y
x+y
• Nor x
y
xÅy
• Xor x
y
11
Not gate (inverter) and Not gate
truth table
x
x
Input Output
0 1
1 0
12
OR gate
x x+y
y
x y x+y
0 0 0
0 1 1
1 0 1
1 1 1 13
NOR gate and truth table
x x+y
y
x y X+y
0 0 1
0 1 0
1 0 0
1 1 0 14
AND gate and AND truth table
x xy x xyz
y y
z
x y xy
0 0 0
0 1 0
1 0 0
1 1 1 15
NAND gate and truth table
x xy
y
x y Output
0 0 1
0 1 1
1 0 1
1 1 0 16
Exclusive-OR gate or abbreviated as XOR
and the truth table
x xÅy
y
x y X’ y’ Xy’ X’y Z=Xy’+x’y
0 0 1 1 0 0 0
0 1 1 0 0 1 1
1 0 0 1 1 0 1 17
Exclusive-NOR gate abbreviated
as XNOR and the truth table
27
2-NAND gate and I-NOR gate
28
2-NAND gate and I-NOR gate
29
Converting between circuits and
equations
• Find the output of the following circuit
x x+y
y (x+y)y
y y
__
• Answer: (x+y)y
– Or (xy)y 30
Converting between circuits and
equations
• Find the output of the following circuit
x
x xy xy
y
y
___
__
• Answer: xy
– Or (xy) ≡ xy 31
Converting between circuits and
equations
• Write the circuits for the following
Boolean algebraic expressions
__
a) x+y
x x+y
x
y
32
Converting between circuits and
equations
• Write the circuits for the following
Boolean
_______
algebraic expressions
b) (x+y)x
x x+y
x+y (x+y)x
y
33
Writing xor using and/or/not
• p Å q (p q) ¬(p q) x y xÅy
____
1 1 0
• x Å y (x + y)(xy) 1 0 1
0 1 1
0 0 0
x x+y (x+y)(xy)
y
xy xy
34
The half-adder
x y Carry Sum
• Sum = x XOR y 0 0 0 0
• Carry = x AND y 0 1 0 1
1 0 0 1
1 1 1 0
x x
y y Sum
Sum
Carry
Carry
35