The Gateway to Computer Science Excellence
+25 votes

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$ are 1. In the circuit diagram for the majority function shown below, the logic gates for the boxes labeled P and Q are, respectively,


  1. XOR, AND
  2. XOR, XOR
  3. OR, OR
  4. OR, AND
in Digital Logic by
edited by | 3.7k views

(D) is the correct choice!

unable to understand the solution to this question

3 Answers

+57 votes
Best answer
Given expression:


Or, $x(y \: op_1 \: z) + \bar{x}(y \: op_2 \: z) = f \quad \to (1)$

\textbf{X}&    \textbf{Y}&  \textbf{Z}&\bf{ Output(f)}\\\hline
0&0&0&0 \\\hline 0&0&1&0\\ \hline    0&1&0&0 \\ \hline   0&1&1&1\\ \hline   1&0&0& 0 \\ \hline   1&0&1&1  \\ \hline   1&1&0& 1 \\ \hline   1&1&1&1\\ \hline
\textbf{x\\yz}&    \textbf{00}&  \textbf{01}&\bf{ 11}& \textbf{10} \\\hline
0&...&...&1&... \\\hline ...&...&1&1&1\\ \hline

$f \implies xz+xy+yz$

$\quad \implies xz+xy+(x+\bar{x})yz $

$\quad \implies xz+xy+xyz+\bar{x}yz$

$\quad \implies x(z+y+yz)+\bar{x}yz$

$\quad \implies x[z+y(1+z)]+\bar{x}(y \bullet z)$

$\quad \implies x(z+y) + \bar{x}(y \bullet z) \quad \to (2)$

Comparing $(1)$ and $(2)$ we get,

$OP_1 = + (OR)$

$OP_2 = \bullet (AND)$

Correct Answer: $D$
edited by
Why not OR OR?
Check Now...i have given answer in details

I tried with OR OR and I'm getting f as majority too. Where am I wrong?

The requirement was when the number of 1 is high only then F will be "1".

In your case , you are getting F as 1 even for 001 & 010. Where number of 1 is less than number of 0. Each having two zeros.

It should  be select as a best answer :)
Thank You

why xP+x¯Q=f

why not x¯P+xQ=f

please anyone explain

the conventions are mentioned in the figure
+22 votes
Ans : D) OR,AND

This is because the value of 'f' should be 1 whenever a majority of the variables is 1. If we select x as '1' , the either of z or y or both z& y needs to be 1 for the output 'f' to be '1'

The output can be low only if less than 2 variables are high. ie.atleast 2 variables are low. hence z & y should be 0. therefore AND gates can be used.
can anyone explain it please?

The simplest method, no need to go for wasting time in k-map.

The function is 1 only when the majority is one, it means in function f(x,y,z) at least two var. must be 1.

X Y Z f(x,y,z)
0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 1

now observe from the given mux and the above table:

when x = 1, in order to get f(x,y,z) = 1, there must be OR between y and z.

when x == 0, in order to get f(x,y,z) = 1, there must be AND between y and z.  

+1 vote

Here when x=0 we get Q operator and when x=1 we get P operator.

So looking to the truth table in below image:

we can see when x=0 yz do AND operation and when x=1 yz do OR operation.
So P is OR gate and Q is AND gate.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,315 questions
60,428 answers
95,238 users