Skip to main content

Subsection 2.8.2 Some Additional Useful Operators

There are, however, three more operators that can be useful. One of them corresponds to an everyday notion. We’ve mentioned it before: exclusive or. The other two aren’t going to seem intuitive to you, but they are useful in circuit design (as is exclusive or). The three we may care about are:

  • exclusive or (written, “p XOR q” or “pq”) is true when exactly one (but not both) of its two operands is true.

  • NAND (standing for, not and) is equivalent to ¬(pq). In other words, it is true when pq is false and thus the not of it is true. Alternatively, at least one of p and/or q is false.

  • NOR (standing for, not or) is equivalent to ¬(pq). In other words, it is true when pq is false and thus the not of it is true. Alternatively, neither p nor q is true.

So that we can see the whole picture here’s a single truth table that includes all 16 possible binary Boolean operators:

p q T pq qp p pq q pq pq p NAND q p XOR q ¬q ¬p p NOR q F
T T T T T T T T T T F F F F F F F F
T F T T T T F F F F T T T T F F F F
F T T T F F T T F F T T F F T T F F
F F T F T F T F T F T F T F T F T F

Nifty Aside

Boolean logic forms the basis for electronic circuit design. If we let T correspond to 1 and F correspond to 0, we can build circuits, for example, to perform binary arithmetic. In addition to the operators that we'd already defined, three of our new ones, XOR, NAND, and NOR are particularly useful in building circuits.

Exercises Exercises

1.

1. For what values of p, q, and r is the expression, “(p XOR q) ∧ r” true? (Let v1, v2, v3 be the values of p, q, and r, respectively.)

  1. T, F, T

  2. T, F, F

  3. F, T, T

  4. T, T, T

  5. two of these

Answer.
Correct answer is E.
Solution.
Explanation: If you write out the truth table for this expression, you’ll see that it is true in two cases: T, F, T and F, T, T.

2.

For how many values of p, q, and r is the expression, “(p NAND q) NAND r” true? (In other words, how many rows of the expression’s truth table contain T in the last column?)

Answer.
Type in box: Correct answer is 5 or five
Solution.
Explanation: Let v1, v2, v3 be the values of p, q, and r, respectively. Then the values that make this expression true are T, T, T and T, T, F and T, F, F and F, T, F and F, F, F.