有没有简单的方法来学习真值表?

Kev*_*161 0 logic truthtable

我正在关注Ruby的在线教程,我正在提及真值表,以及在继续之前我需要学习它们.

有没有简单的方法来学习它们?我只需要了解真假的构成吗?

Dig*_*oss 10

不要记住真值表

重要的是理解用于计算真值表的函数.当你理解这些功能时,真值表将是显而易见的.

A OR  B: Either A or B    # cream OR sugar, T if either (or both), F if neither
A AND B: Both A and B     # cream AND sugar, T only when the coffee has both
A XOR B: One but not both # T only if sugar but no cream or if cream but no sugar
NOT   A: Kind of obvious  # NOT sugar, true if the tea has no sugar

A NAND B: NOT (A AND B)   # T unless both cream and sugar are in the tea
A NOR  B: NOT (A OR B)    # T only if there is no sugar and also no cream
Run Code Online (Sandbox Code Playgroud)