How to make logical OR with AND,and NOT?

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

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

5条回答
  •  感情败类
    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
    

提交回复
热议问题