The GATE Grind

GATE 2015 CS – Question 40

Digital Logic · Boolean Algebra and Minimization · 2 marks · Multiple choice

The binary operator $\neq$ is defined by the following truth table.

$p$$q$$p \neq q$
000
011
101
110

Which one of the following is true about the binary operator $\neq$?

  1. Both commutative and associative
  2. Commutative but not associative
  3. Not commutative but associative
  4. Neither commutative nor associative

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) Both commutative and associative

Explanation

The table gives the exclusive-OR operation. Swapping $p$ and $q$ does not change the output, so it is commutative. Exclusive-OR is also associative, since $(p \oplus q) \oplus r$ and $p \oplus (q \oplus r)$ are both 1 exactly when an odd number of the three inputs are 1.