Skip to content
BetterDL

Majority function

Also called: majority, majority gate, majority vote, voting function, 2-of-3 majority

A function that outputs 1 when more than half of its inputs are 1. For three inputs it is AB + AC + BC.

The majority function outputs whatever most of its inputs say. With three inputs A, B and C it is 1 when at least two of them are 1:

Each product covers one pair being 1, and the OR collects them. Its truth table has 1s in rows 011, 101, 110 and 111.

It is a classic simplification exercise. The canonical form has four minterms, , and can combine with each of the other three. Copying it twice with the idempotent law gives the three two-literal products.

Where it shows up:

  • Voting and fault tolerance. Three copies of a circuit vote, and a single faulty copy is outvoted.
  • Adders. The carry out of a full adder is the majority of its three inputs: a carry happens when at least two of A, B and the carry in are 1.

Notice what the minimal form is not: ("exactly two") leaves out row 111 and has no simpler SOP.

0000
0010
0100
0111
1000
1011
1101
1111

Worked examples

Example

Reading the expression row by row

Check on rows 101 and 100.

  1. 1.

    Row 101 (A = 1, B = 0, C = 1): two inputs are 1, so the majority is 1. = 1, so the expression is 1. ✓

  2. 2.

    Row 100 (A = 1, B = 0, C = 0): only one input is 1, so the majority is 0. = 0, = 0 and = 0, so the expression is 0. ✓

  3. 3.

    Each product checks one pair. If any pair is all 1s, at least two inputs are 1.

Example

A carry is a majority

A full adder adds bits A, B and a carry in C. When is there a carry out?

  1. 1.

    The column sum A + B + C (ordinary addition) ranges from 0 to 3.

  2. 2.

    A carry out happens when that sum is 2 or 3, that is, when at least two of the bits are 1.

  3. 3.

    So the carry out is the majority function, .

  4. 4.

    Example: A = 0, B = 1, C = 1 sums to 2 = 10₂, carry 1. = 1. ✓

Common mistakes

  • Using each minterm only once and ending up with a term left over. must be reused.

  • Confusing "at least two" with "exactly two". The majority includes row 111.

Practice Majority function

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Majority function is taught in Boolean Algebra and Adders and ALUs.