numeric ranges and sets:
x > 33 AND x < 67 p = 2 OR p is odd NOT y = 0
on-line searches:
explicit: library
implicit: amazon; imdb; google; kayak ...
car warranties: 3 years OR 30,000 miles
Boolean logic is everywhere!
a NOT a
---------
F T
T F
a b a AND b a b a OR b
--------------- ---------------
F F F F F F
F T F F T T
T F F T F T
T T T T T T
Consider: (NOT p) AND (NOT q)
p q NOT p NOT q --------------------------------------------- F F T T T F T T F F T F F T F T T F F F
Expressions do not have to mean anything.
Some expressions are never true.
a b (NOT (a OR b)) AND a ---------------------------- F F F F T F T F F T T F
Some expressions are always true.
p q (NOT (p AND q)) OR q ------------------------------------------ F F T F T T T F T T T T
One of DeMorgan's Laws:
a b (NOT a) AND (NOT b) NOT (a OR b) --------------------------------------------- F F T T F T F F T F F F T T F FThe NOT of the OR is the AND of the NOTs.
"If a then b."
a b a → b (NOT a) OR b ----------------------------- F F T T F T T T T F F F T T T T
inputs outputs a b c s c terms s terms -------------------------------------------- 0 0 0 0 0 1 0 1 (NOT a) AND b 1 0 0 1 a AND (NOT b) 1 1 1 0 a AND b
What does this capture?
sum = a XOR b carry = a AND b
a b a XOR b --------------- F F F F T T T F T T T F