GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 2.8

Commutative but nonassociative operator

Digital Logic · Boolean Algebra & Logic Gates · Full GATE CSE 1998 paper

GATE 1998, Q2.8 2 marks · MCQ
Report issue

Boolean Algebra & Logic Gates

Question 2.8, GATE 1998: Which is commutative but not associative: AND, OR, NAND, XOR?
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

NAND is symmetric in its arguments because ¬(ab)=¬(ba), so it is commutative. To test associativity, take a=0, b=1, c=1. Then (0 NAND 1) NAND 1=1 NAND 1=0, while 0 NAND(1 NAND 1)=0 NAND 0=1. The two groupings differ, proving nonassociativity. AND, OR and XOR are associative as well as commutative. Thus C; a single counterexample is enough to refute an asserted universal associative law.

Original paper, page 4