GATE Computer ScienceHardGATE CS (PYQ pattern)

Of the 16 Boolean functions f(x, y) of two variables, how many are associative, i.e. f(f(x,y),z) = f(x,f(y,z)) for all x, y, z?

  1. A. 6
  2. B. 8
  3. C. 4
  4. D. 10

Correct answer: B. 8

Associative ones: the constants 0 and 1, AND, OR, XOR, XNOR, and the two projections f = x and f = y. (NAND, NOR, implication and the others fail.) That makes 8; only 6 of these are also commutative (the projections are not).

More Digital Logic questions

Exams that ask this topic