Majority VoteProjectCombinational Logic
On this page

Activity 2.2.6 — Majority Vote Circuit Design

The Problem: Three judges vote on a competition. A performer advances only if at least 2 of 3 judges say yes. How do you build a circuit that makes this decision automatically?


Learning Objectives

By the end of this lesson, students will be able to:

  1. Design a combinational logic circuit from a word problem specification
  2. Create a truth table for a majority vote function (3 inputs, 2+ HIGH = output HIGH)
  3. Simplify the Boolean expression using K-maps
  4. Implement the circuit using AOI logic gates
  5. Convert to NAND-only implementation

Vocabulary

Vocabulary (click to expand)
TermDefinition
Majority FunctionA logic function where output is HIGH when more than half the inputs are HIGH
M-of-N LogicOutput is HIGH when at least M of N inputs are HIGH
Design from SpecificationCreating a circuit starting from a written problem description
Cascade DesignBuilding a complex circuit from smaller, simpler sub-circuits

Part 1: Understanding Majority Vote Logic

The majority vote function is a classic combinational logic problem used in voting systems, error detection, and redundant systems.

Definition

For N inputs, the majority vote output is HIGH when more than N/2 inputs are HIGH.

For our case with 3 inputs (A, B, C):

  • Output Y = HIGH when at least 2 of 3 inputs are HIGH
  • This covers four cases: (1,1,0), (1,0,1), (0,1,1), and (1,1,1)

Key insight: “At least 2 out of 3” means exactly 2 HIGH or all 3 HIGH. You’re looking for any pair of inputs that are both 1.


Part 2: 3-Input Majority Vote Design

Step 1 — Create the Truth Table

With 3 inputs there are 2³ = 8 possible combinations. For each row, count how many inputs are HIGH:

RowABC# HIGHY
000000
100110
201010
301121
410010
510121
611021
711131

Check your work: Rows 3, 5, 6, and 7 have 2 or more HIGH inputs. Those are the minterms m3, m5, m6, m7.

Step 2 — Write the Boolean Expression (SOP)

Pull the minterms where Y = 1:

MintermABCProduct Term
m3011A’BC
m5101AB’C
m6110ABC’
m7111ABC

Unsimplified SOP:

Y = A’BC + AB’C + ABC’ + ABC

Step 3 — Simplify with Boolean Algebra

Combine terms that differ by only one variable:

PairCombined
m5 + m7: AB’C + ABCAC(B’ + B) = AC
m6 + m7: ABC’ + ABCAB(C’ + C) = AB
m3 + m7: A’BC + ABCBC(A’ + A) = BC

Simplified:

Y = AB + BC + AC

Key insight: Each term represents one pair of inputs. The output is HIGH when any pair is both HIGH.

Step 4 — Verify with a K-Map

A \ BC00011110
00010
10111

Groups (three overlapping pairs):

GroupCellsTerm
Pair 1m5, m7AC
Pair 2m6, m7AB
Pair 3m3, m7BC

All three groups share cell m7 (overlapping is allowed). Result matches the algebra: Y = AB + BC + AC

Step 5 — Draw the Circuit

        ┌──────┐
A ──┬───┤ AND  ├──┐
B ──┤   └──────┘  │
    │             │   ┌────────┐
    │   ┌──────┐  ├───┤        │
    ├───┤ AND  ├──┤   │ 3-in   ├── Y
    │   └──────┘  ├───┤  OR    │
B ──┤             │   │        │
C ──┤   ┌──────┐  │   └────────┘
    ├───┤ AND  ├──┘
A ──┘   └──────┘
C ──────┘

Gate count: 3 × 2-input AND gates + 1 × 3-input OR gate

ICs needed:

  • 74HC08 (quad 2-input AND) — uses 3 of 4 gates
  • 74HC32 (quad 2-input OR) — use 2 gates cascaded for 3-input OR

Step 6 — Verify Each Case

ConditionABBCACY = AB + BC + AC
A=1, B=1, C=01001 ✓
A=1, B=0, C=10011 ✓
A=0, B=1, C=10101 ✓
A=1, B=1, C=11111 ✓

All cases match the truth table.


Part 3: NAND-Only Implementation

Since NAND gates are universal (and the 74HC00 IC is cheap and plentiful), converting to NAND-only is a standard skill.

Conversion

Start with: Y = AB + BC + AC

Apply double complement and DeMorgan’s:

Y = ( (AB)’ · (BC)’ · (AC)’ )’

Circuit uses 4 NAND gates:

        ┌───────┐
A ──┬───┤ NAND  ├──┐
B ──┤   └───────┘  │
    │              │   ┌────────┐
    │   ┌───────┐  ├───┤        │
    ├───┤ NAND  ├──┤   │ NAND   ├── Y
    │   └───────┘  ├───┤        │
B ──┤              │   └────────┘
C ──┤   ┌───────┐  │
    ├───┤ NAND  ├──┘
A ──┘   └───────┘
C ──────┘

ICs needed: Just one 74HC00 (quad 2-input NAND) — uses all 4 gates.


Part 4: Extending to 5-Input Majority Vote

The Challenge

Design a circuit with 5 inputs (A, B, C, D, E) where output Y is HIGH when at least 3 of 5 inputs are HIGH.

With 5 inputs, the truth table has 2⁵ = 32 rows. The minterms where Y = 1:

Exactly # HIGHCountCombinations
3C(5,3) =10
4C(5,4) =5
5C(5,5) =1
Total16 minterms

That’s a lot. Instead of writing all 32 rows, engineers use cascade design.

Cascade Approach

Build the 5-input majority from smaller 3-input majority blocks:

Stage 1 — Three 3-input majority voters:

  • M1 = majority(A, B, C)
  • M2 = majority(A, B, D)
  • M3 = majority(A, B, E)

Stage 2 — One more majority voter:

  • Y = majority(M1, M2, M3)
     ┌─────────────┐
A ───┤ Maj(A,B,C)  ├── M1 ──┐
B ───┤             │         │   ┌─────────────┐
C ───┘             │         ├──┤ Maj(M1,M2,3) ├── Y
     ┌─────────────┐         │  └─────────────┘
A ───┤ Maj(A,B,D)  ├── M2 ──┤
B ───┤             │         │
D ───┘             │         │
     ┌─────────────┐         │
A ───┤ Maj(A,B,E)  ├── M3 ──┘
B ───┤             │
E ───┘             │

Key insight: Breaking a complex problem into smaller, tested modules makes design and debugging much easier. Each 3-input block is just Y = AB + BC + AC from Part 2.


Part 5: Real-World Applications

Triple Modular Redundancy (TMR)

Three sensors measure the same value in a safety-critical system. The majority vote determines the accepted reading — one faulty sensor is automatically outvoted.

ScenarioSensor ASensor BSensor CMajority Output
All OK1111 ✓
One faulty1011 ✓ (faulty B outvoted)
Two faulty0010 ✗ (majority wrong)

TMR tolerates 1 sensor failure. This is used in aerospace, nuclear, and medical systems.

Other Applications

  • Error correction — Data bits are repeated; majority vote recovers the correct value
  • Fault-tolerant computing — Multiple processors vote on results
  • Election systems — The literal definition of majority voting

Practice Problems

Problem 1 — 4-Input Majority

For a 4-input majority vote circuit (output HIGH when at least 3 of 4 inputs are HIGH), determine how many minterms produce Y = 1.

Show Answer
Exactly # HIGHCombinations
3C(4,3) = 4
4C(4,4) = 1
Total5 minterms

Problem 2 — NAND Conversion

Convert Y = AB + BC + AC to NAND-only form. How many NAND gates are needed?

Show Solution

Y = ( (AB)’ · (BC)’ · (AC)’ )’

  1. NAND(A, B) → (AB)’
  2. NAND(B, C) → (BC)’
  3. NAND(A, C) → (AC)’
  4. NAND(outputs of 1, 2, 3) → Y

4 NAND gates — fits on a single 74HC00 IC.


Problem 3 — Design Challenge

A school cafeteria needs a voting system where 3 student representatives each have a switch. A proposal passes if at least 2 of 3 vote YES. Complete the full design process.

Show Solution

This is the 3-input majority vote from Part 2.

Truth Table: (same as Step 1)

ABCY
0000
0010
0100
0111
1000
1011
1101
1111

Simplified: Y = AB + BC + AC

Hardware: 3 input switches with pull-down resistors → 74HC08 (AND gates) → 74HC32 (OR gate) → output LED with current-limiting resistor

Or NAND-only: Single 74HC00 IC (4 NAND gates)


Summary

ConceptKey Takeaway
Majority voteOutput HIGH when > half of inputs are HIGH
3-input expressionY = AB + BC + AC (any pair is both HIGH)
K-map groupingThree overlapping groups of 2
NAND conversion4 gates on one 74HC00 IC
5-input extensionCascade from 3-input blocks
Real-world useTMR, error correction, voting systems

Custom activity — adapted from PLTW Digital Electronics