Multiple choice

Which of the following operations is commutative but not associative?

  1. AND

  2. OR

  3. NAND

  4. EXOR

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

NAND is commutative: A ↑ B = B ↑ A. However, NAND is NOT associative: (A ↑ B) ↑ C ≠ A ↑ (B ↑ C). For example, if A=B=C=0, then (0 ↑ 0) ↑ 0 = 1 ↑ 0 = 0, but 0 ↑ (0 ↑ 0) = 0 ↑ 1 = 1. AND and OR are both associative and commutative. EXOR (XOR) is both associative and commutative.