How to make logical OR with AND,and NOT?

前端 未结 5 1811
执念已碎
执念已碎 2021-01-08 01:42

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

相关标签:
5条回答
  • 2021-01-08 01:43

    Pretty simple:

    A || B = !(!A && !B)
    
    0 讨论(0)
  • 2021-01-08 01:52

    Like not (not x and not y) ?

    0 讨论(0)
  • 2021-01-08 01:52

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

    0 讨论(0)
  • 2021-01-08 02:04

    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
    
    0 讨论(0)
  • 2021-01-08 02:05

    Check De Morgans's laws. You are looking for the Substitution form.

    P OR Q = NOT( (NOT P) AND (NOT Q) )
    
    0 讨论(0)
提交回复
热议问题