Boolean Logic: Boolean Truth Tables
Boolean Logic: Boolean Truth Tables
Now comes the moment of truth. The day of truth-ment, if you will. How does a computer represent (and understand) a truth table?
Much easier than other things we make computers represent, seeing as each table cell can only be True or False. Computers can represent True with a 1 and False with a 0, so they're basically perfect for this kind of job.
Just take any truth table and replace "True" with 1 and "False" with 0. It’s that easy. No critical thinking involved.
The boolean truth tables for X ∧ Y and X ∨ Y looks like this:
X | Y | X ∧ Y | X ∨ Y |
1 | 1 | 1 | 1 |
1 | 0 | 0 | 1 |
0 | 1 | 0 | 1 |
0 | 0 | 0 | 0 |
You can also get the negation in the same way as with non-boolean truth tables: flip all the 0s to 1s and the 1s to 0s.
If proposition X is 1 (True), then its negation, ~X, is 0 (False). If proposition X is 0 (False), then its negation, ~X, is 1 (True).
X | Y | X ∧ Y | ~ (X ∧ Y) |
1 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
0 | 1 | 0 | 1 |
0 | 0 | 0 | 1 |
Binary and Booleans were made for each other. It's written in the tables.