如何使用AND进行逻辑OR,而不是?

MyN*_*sMy 12 boolean-logic

如何使用逻辑AND和逻辑NOT创建逻辑OR?

Udo*_*eld 23

检查De Morgans的法律.您正在寻找替代表格.

P OR Q = NOT( (NOT P) AND (NOT Q) )
Run Code Online (Sandbox Code Playgroud)

  • +1 提到德摩根定律。我自己回答问题的时候想不出名字。 (2认同)

mil*_*use 11

这是德摩根定律:

A OR B = NOT ( NOT A AND NOT B )
Run Code Online (Sandbox Code Playgroud)

A OR B的真值表:

A B  X
0 0  0
0 1  1
1 0  1
1 1  1
Run Code Online (Sandbox Code Playgroud)

De Morgan等价物的真值表:

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
Run Code Online (Sandbox Code Playgroud)


Mic*_*ker 9

喜欢not (not x and not y)


K M*_*hta 6

很简单:

A || B = !(!A && !B)
Run Code Online (Sandbox Code Playgroud)