Chap2 Gates
Chap2 Gates
Ali Saleh
Logic Gates
The Modest Switch
• Manual Switch
• A switch is pushed manually, raised to a high voltage
• Which makes the current flow through the bulb
Output
Input Output
Input2
Input1
Output
Input2
Logic gate:
1 0
Symbol
Input Output
A
Y
B
1 0 0
1 1 1
A
Y
B
• This is an OR gate. A B Y
• So, if either of the two
0 0 0
input signals are
asserted, or both of 0 1 1
them are, the output
1 0 1
will be asserted.
1 1 1
3 Input OR Gate
Logic gates:
(AB)’
A’+B’=(AB)’
• x 0fascinating
Several =x x XOR
properties of the 1 = x’operation:
xx=0 x x’ = 1
x (y z) = (x y) z [ Associative ]
xy=yx [ Commutative ]
x y z xyz
x (y z) 0 0 0 0
= x (y’z + yz’) [ Definition of XOR ] 0 0 1 1
= x’(y’z + yz’) + x(y’z + yz’)’ [ Definition of XOR ] 0 1 0 1
= x’y’z + x’yz’ + x(y’z + yz’)’ [ Distributive ] 0 1 1 0
= x’y’z + x’yz’ + x((y’z)’ (yz’)’) [ DeMorgan’s ]
1 0 0 1
= x’y’z + x’yz’ + x((y + z’)(y’ + z)) [ DeMorgan’s ]
= x’y’z + x’yz’ + x(yz + y’z’) [ Distributive ] 1 0 1 0
= x’y’z + x’yz’ + xyz + xy’z’ [ Distributive ] 1 1 0 0
1 1 1 1
• XOR is especially useful for building adders (as we’ll see on later) and error
detection/correction circuits.
x y (xy)’
0 0 1
0 1 0 (x y)’ = x’y’ + xy
1 0 0
1 1 1