Activity 2.2.6 — Majority Vote Circuit Design¶
Learning Objectives¶
By the end of this lesson, students will be able to:
- Design a combinational logic circuit from a word problem specification
- Create a truth table for a majority vote function (3 inputs, 2+ HIGH = output HIGH)
- Simplify the Boolean expression using K-maps
- Implement the circuit using logic gates
- Extend the design to handle 5 inputs (3+ HIGH = output HIGH)
Vocabulary¶
Vocabulary (click to expand)
| Term | Definition |
|---|---|
| Majority Function | A logic function where output is HIGH when more than half the inputs are HIGH |
| M-of-N Logic | Output is HIGH when at least M of N inputs are HIGH |
| Design from Specification | Creating a circuit starting from a written problem description |
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: - 3-input majority: Output HIGH when at least 2 of 3 inputs are HIGH - 5-input majority: Output HIGH when at least 3 of 5 inputs are HIGH
Key insight: "At least 2 out of 3" means: 2 HIGH, or 3 HIGH. Cases: (1,1,0), (1,0,1), (0,1,1), (1,1,1)
Part 2: 3-Input Majority Vote Design¶
Problem Statement¶
Design a circuit with 3 inputs (A, B, C) where the output Y is HIGH when at least 2 of the 3 inputs are HIGH.
Step 1: Create Truth Table¶
There are 8 possible input combinations (2^3 = 8):
| A | B | C | Y (Majority) | At Least 2 HIGH? |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | No |
| 0 | 0 | 1 | 0 | No (only 1) |
| 0 | 1 | 0 | 0 | No (only 1) |
| 0 | 1 | 1 | 1 | YES (2) |
| 1 | 0 | 0 | 0 | No (only 1) |
| 1 | 0 | 1 | 1 | YES (2) |
| 1 | 1 | 0 | 1 | YES (2) |
| 1 | 1 | 1 | 1 | YES (3) |
Step 2: Write Boolean Expression¶
The minterms where Y = 1: - m3 (A' B C): 011 - m5 (A B' C): 101 - m6 (A B C'): 110 - m7 (A B C): 111
Expression: Y = A'BC + AB'C + ABC' + ABC
Simplify: Group m5,m7: AC(B'+B) = AC
Group m6,m7: AB(C'+C) = AB
Group m3,m7: BC(A'+A) = BC
Y = AC + AB + BC
Or factored: Y = (A·B) + (B·C) + (A·C)
Key insight: This is the classic majority vote expression: output is HIGH when any two inputs are HIGH.
Step 3: Simplify Using K-Map¶
3-variable K-map:
| BC=00 | BC=01 | BC=11 | BC=10 | |
|---|---|---|---|---|
| A=0 | 0 | 0 | 1 | 0 |
| A=1 | 0 | 1 | 1 | 1 |
Grouping:
- Group of 2: m5,m7 → AC
- Group of 2: m6,m7 → AB
- Group of 2: m3,m7 → BC
These three groups of 2 overlap at m7, which is fine.
Simplified Expression: Y = AB + BC + AC
This matches our algebraic result! ✓
Step 4: Draw Circuit¶
Circuit diagram:
Using 3 AND gates (2-input) and 1 OR gate (3-input).
Step 5: Verify¶
Check each output condition: - A=1,B=1,C=0: AB=1 → Y=1 ✓ - A=1,B=0,C=1: AC=1 → Y=1 ✓ - A=0,B=1,C=1: BC=1 → Y=1 ✓ - A=1,B=1,C=1: All products =1 → Y=1 ✓
Part 3: Understanding the Expression¶
The expression Y = AB + BC + AC has important properties:
Alternative Forms¶
Sum of Products: Y = AB + BC + AC
Factored Form: Y = (A + B)(A + C)(B + C) — Try verifying this!
Interesting Property¶
Notice that AB + BC + AC = (A ⊕ B)·C + A·B [using XOR]
But the simple form AB + BC + AC is easiest to implement.
Implementation with NAND¶
Since NAND gates are universal and readily available, let's convert to NAND-only:
Y = AB + BC + AC = ((AB)' · (BC)' · (AC)')' [NAND of NANDs]
Circuit uses 4 NAND gates.
Part 4: Extending to 5-Input Majority Vote¶
Problem Statement¶
Design a circuit with 5 inputs where output Y is HIGH when at least 3 of the 5 inputs are HIGH.
Approach¶
With 5 inputs, we have 32 combinations (2^5 = 32). We'll need to identify all cases where output = 1:
Cases where Y = 1: - Exactly 3 inputs HIGH: C(5,3) = 10 combinations - Exactly 4 inputs HIGH: C(5,4) = 5 combinations - Exactly 5 inputs HIGH: C(5,5) = 1 combination
Total: 10 + 5 + 1 = 16 minterms
Simplification Strategy¶
Rather than write all 32 rows, we can use a systematic approach:
- Identify all 3-input combinations (C(5,3) = 10)
- Identify all 4-input combinations (C(5,4) = 5)
- Identify all 5-input combination (1)
For 5 variables (A,B,C,D,E), each minterm represents a combination like ABC'D'E (where ' = complemented).
Alternative: Build from 3-Input Modules¶
A practical approach is to use multiple 3-input majority modules: - First stage: Two 3-input majority voters - Second stage: 3-input majority of the two stage outputs + remaining input
This is called cascading and is a common engineering approach.
Cascade Design¶
Inputs: A, B, C, D, E
Stage 1:
- Majority3_1: inputs A, B, C → M1
- Majority3_2: inputs D, E, (tie to ground or use one from first group)
Actually, better approach:
Stage 1: Majority(A, B, C) → M1
Majority(A, B, D) → M2
Majority(A, B, E) → M3
Stage 2: Majority(M1, M2, M3) → Final Output
This cascades the majority decision to ensure at least 3 of the 5 are needed.
Key insight: For complex functions, breaking into smaller modules that can be tested individually makes design and debugging much easier.
Part 5: Practical Applications¶
Real-World Uses of Majority Voting¶
-
Redundant Systems: In aerospace and nuclear systems, multiple sensors measure the same value. The majority vote determines the output, tolerating up to N-1 sensor failures.
-
Error Correction: Data transmission systems use majority voting to correct single-bit errors.
-
Fault-Tolerant Computing: Multiple processors vote on the correct output.
-
Election Systems: Democratic voting is essentially a majority function.
Example: Triple Modular Redundancy (TMR)¶
Three sensors measure temperature: - If 2 or 3 sensors agree, that's the accepted reading - One faulty sensor is tolerated
Circuit: Three sensors → 3-input majority voter → system decision
Practice Problem — Majority Vote¶
Problem 1: For a 4-input majority vote circuit (output HIGH when at least 3 of 4 inputs are HIGH), create the truth table for first 8 rows.
Show Solution
| A | B | C | D | Y (Majority of 4) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 (0 of 4) |
| 0 | 0 | 0 | 1 | 0 (1 of 4) |
| 0 | 0 | 1 | 0 | 0 (1 of 4) |
| 0 | 0 | 1 | 1 | 1 (2 of 4 - not majority for 4) |
| 0 | 1 | 0 | 0 | 0 (1 of 4) |
| 0 | 1 | 0 | 1 | 1 (2 of 4 - not majority) |
| 0 | 1 | 1 | 0 | 1 (2 of 4 - not majority) |
| 0 | 1 | 1 | 1 | 1 (3 of 4 - YES majority!) |
Note: For 4-input, "majority" means 3 or 4 HIGH (more than half, which is 2). So need at least 3 HIGH.
Problem 2: Implement Y = AB + BC + AC using only NAND gates. Draw the circuit.
Show Solution
Step 1: Original expression: Y = AB + BC + AC
Step 2: Write as NAND of NANDs: Y = ((AB)' · (BC)' · (AC)')'
Circuit: 1. NAND(A, B) → (AB)' 2. NAND(B, C) → (BC)' 3. NAND(A, C) → (AC)' 4. NAND(outputs of 1,2,3) → Y
Total: 4 NAND gates needed.
This is the NAND-only implementation!
Problem 3: The school cafeteria needs a voting system where 3 student representatives vote on a proposal (each has a switch). The proposal passes if at least 2 of 3 vote YES. Draw the complete design (truth table, simplified expression, circuit).
Show Solution
This is exactly the 3-input majority vote we designed in Part 2!
Truth Table: (From earlier) | A | B | C | Y | |---|---|---|---| | 0 | 0 | 0 | 0 | | 0 | 0 | 1 | 0 | | 0 | 1 | 0 | 0 | | 0 | 1 | 1 | 1 | | 1 | 0 | 0 | 0 | | 1 | 0 | 1 | 1 | | 1 | 1 | 0 | 1 | | 1 | 1 | 1 | 1 |
Simplified Expression: Y = AB + BC + AC
Circuit: - 3 input switches with pull-down resistors - 3 AND gates (for AB, BC, AC) - 1 OR gate (3-input) to combine - Output LED with resistor
Hardware: - Use 74HC08 (quad 2-input AND) + 74HC32 (quad 2-input OR) - Or use NAND-only: 74HC00 (quad 2-input NAND)
Summary¶
- Majority vote: output HIGH when more than half inputs are HIGH
- 3-input majority: Y = AB + BC + AC (any two or all three)
- K-map simplification shows three overlapping groups of 2
- 5-input majority can be designed directly or cascaded from 3-input modules
- Real-world applications include redundant systems, error correction, fault tolerance
Key Reminders¶
- "At least 2 of 3" means: exactly 2 OR exactly 3 HIGH
- K-map grouping for majority: three overlapping groups of 2
- Use factored form Y = (A+B)(A+C)(B+C) for POS implementation if needed
- For larger inputs (5+), consider cascade design to simplify implementation
Assessment Rubric — Majority Vote Circuit¶
| Criterion | 4 — Exemplary | 3 — Proficient | 2 — Developing | 1 — Beginning |
|---|---|---|---|---|
| Truth Table | Complete (8 rows for 3-input), all correct | Complete, minor errors | Incomplete | Missing/incorrect |
| Boolean Expression | Correct minterms or simplified form | Correct | Minor errors | Incorrect |
| Simplification | K-map grouped correctly, expression minimized | K-map correct | Attempted, errors | No attempt |
| Circuit | Clear, complete with gates labeled | Circuit shown | Partial circuit | No circuit |
| Extension (5-input) | Shows systematic approach or cascade | Approach identified | Mentioned | Not addressed |
Custom activity — adapted from PLTW Digital Electronics