Five voters each cast a yes (1) or no (0). Output the number of yes votes and whether the motion passes by majority (3 or more yes votes).
Input: votes, 5 bits.
Outputs: count, 3 bits (0 to 5); pass, 1 when count is at least 3.
The testbench applies all 32 vote patterns and checks both outputs.
Contributed by Indicore