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?
- A. 6
- B. 8
- C. 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
- Of the 16 binary operations ∘ on {0, 1}, for how many is ∘ associative AND has a two-sided identity element e (e ∘ x = x ∘ e = x for both…
- A three-input majority gate has each input connected to one of 0, 1, x, y, z, x', y' or z'. How many distinct Boolean functions of x, y, z…
- A single 2:1 multiplexer (output = s ? b : a) has each of its three inputs connected to one of 0, 1, x, y, z (no complemented literals)…
- For how many 8-bit patterns x does there exist some rotation distance k with 1 ≤ k ≤ 7 such that rotating x left circularly by k bits…
- Let g(x) = x XOR (x >> 1) be the 8-bit binary-reflected Gray encoding. What is the smallest k ≥ 1 such that applying g k times returns…
- A bit string is a palindrome if it reads the same forwards and backwards. How many 8-bit palindromes and how many 9-bit palindromes…