Reputation: 193
How to create a logical OR with logical AND, and logical NOT?
Upvotes: 18
Views: 47425
Reputation: 12548
Check De Morgans's laws. You are looking for the Substitution form.
P OR Q = NOT( (NOT P) AND (NOT Q) )
Upvotes: 32
Reputation: 10007
It's De Morgan's Law:
A OR B = NOT ( NOT A AND NOT B )
Truth table for A OR B:
A B X
0 0 0
0 1 1
1 0 1
1 1 1
Truth table for the De Morgan equivalent:
A B !A !B (!A AND !B) !(!A AND !B)
0 0 1 1 1 0
0 1 1 0 0 1
1 0 0 1 0 1
1 1 0 0 0 1
Upvotes: 17