|
It's all about the basics of Boolean logic and Boolean algebra. For an approachable primer, check out the first few (very short) chapters of Code by Charles Petzold.
Or: Is the thing on the left true OR is the thing on the right true?
Example: If it is cold, OR if it is raining, you should put a coat on. (Do you put a coat on if it is cold? What if it is raining? What if it is both cold and raining? What if it is neither cold nor raining?)
And: Is the thing on the left true AND the thing on the right true?
Example: If it is lunch time, AND you are hungry, you should eat. (Do you eat if it is not lunch time and you are not hungry? What if it is lunch time and but you aren't hungry? What if it is lunch time and you are hungry?)
0 is false
1 is true
0 And 1 = 0, because the thing on the left AND the thing on the right are not both true.
|