Learn

0/8
0/6
0/6
0/6

Practice

Majority Voter, Two Ways

Three inputs vote on one output: high wins when at least two inputs are high. The template contains a working truth-table implementation. Add a smaller gate expression with the same behavior, leaving the original available for comparison.

This is optional practice in K-map simplification and adding another implementation behind an existing interface.

  • add a second architecture named minimized to the existing majority_voter entity. Leave the given minterms architecture untouched.

The testbench instantiates the given implementation and yours side by side and drives all eight input combinations; both must produce the majority on every row.

Interface (both implementations)

PortDirectionTypeDescription
a_iin1 bitVoter input A
b_iin1 bitVoter input B
c_iin1 bitVoter input C
vote_oout1 bitMajority: '1' when at least two inputs are '1'

Behavior

  • vote_o is '1' when two or three inputs are '1', and '0' otherwise
  • Both implementations are checked on every one of the 8 input combinations

Constraints

Derive a simplified sum-of-products expression from a K-map. The tests compare output values; they do not count terms in your source.

  • Don't modify the given implementation; the testbench checks it too.
  • Expect the first run to fail before your unit exists: it stops with cannot find architecture "minimized" of entity "majority_voter". Write the architecture and the error disappears.
Loading editor...

Click Run to execute your code. Output will appear here.