MyNameIsMy
MyNameIsMy

Reputation: 193

How to make logical OR with AND,and NOT?

How to create a logical OR with logical AND, and logical NOT?

Upvotes: 18

Views: 47425

Answers (5)

That coworker
That coworker

Reputation: 79

Using DeMorgans law. The Negation of (Not A "And" Not B)

Upvotes: 3

Udo Held
Udo Held

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

millhouse
millhouse

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

K Mehta
K Mehta

Reputation: 10553

Pretty simple:

A || B = !(!A && !B)

Upvotes: 5

Michael Krelin - hacker
Michael Krelin - hacker

Reputation: 143119

Like not (not x and not y) ?

Upvotes: 9

Related Questions