How to create a logical OR with logical AND, and logical NOT?
Pretty simple:
A || B = !(!A && !B)
Like not (not x and not y)
?
Using DeMorgans law. The Negation of (Not A "And" Not B)
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
Check De Morgans's laws. You are looking for the Substitution form.
P OR Q = NOT( (NOT P) AND (NOT Q) )