The majority function is a Boolean function f(x, y, z) that takes the value 1…
2006
The majority function is a Boolean function f(x, y, z) that takes the value 1 whenever a majority of the variables x, y, z and 1. In the circuit diagram for the majority function shown below, the logic gates for the boxes labeled P and Q are, respectively,

- A.
XOR, AND
- B.
XOR, XOR
- C.
OR, OR
- D.
OR, AND
Attempted by 99 students.
Show answer & explanation
Correct answer: D
Key insight: implement the majority function with a 2:1 multiplexer whose select is x.
When x = 1 the multiplexer selects the top input. With x = 1 the majority output is 1 whenever at least one of y or z is 1, so the top box must compute y OR z.
When x = 0 the multiplexer selects the bottom input. With x = 0 the majority output is 1 only when both y and z are 1, so the bottom box must compute y AND z.
Therefore the correct gates are: top = OR, bottom = AND.
Quick verification examples:
Case x=1, y=1, z=1: top = y OR z = 1, output = 1 (majority = 1) — correct.
Case x=0, y=1, z=1: bottom = y AND z = 1, output = 1 (majority = 1) — correct.
Case x=0, y=1, z=0: bottom = y AND z = 0, output = 0 (majority = 0) — correct and would be wrong if OR were used on the bottom input.
A video solution is available for this question — log in and enroll to watch it.