CSCI 150, Spring 2003

Home | | Course Schedule | | Assignments | | Lecture Notes

CSCI 150 Homework 7
The majority function in Circuitmaker

Goals

The Majority function.

The majority function has three inputs, each of which can be either 0 or 1. The truth table has eight lines, one for each possible combination of the inputs. The value of the function is the same as the majority of its inputs. For example, one of the eight lines in the truth table is
ABC Majority
101 1
In this example, the value of the Majority function is 1, because 2 out of three of its inputs are 1. Since there are three inputs, but each input only has two possible values, one of the input values must be repeated at least once. (This observation is called the pigeonhole principle in mathematics.)

The Majority function in Circuitmaker

Your circuit will have three logic switches, one for each of the three inputs, and one logic display. Label the switches A, B, and C. Label the logic display Majority. Design and test a circuit which causes the display to light when the majority of inputs are ones, and go out when the majority are zeros.

The text develops a method for translating an arbitrary function to logic on pages 231 and following, but unfortunately their notation is so unlike the Circuitmaker notation you may have difficulty making the translation. A semi-English description of the method:

Consider each row in the table which has a one in the output.
Build a circuit corresponding to that row, by ANDing together:
Now OR together all the circuits you've just built, and the output of the OR computes the function described in the truth table.
For example, the circuit corresponding to the row given above is:

Of course, if you use this method, each of the input switches may connect to many different gates.

Circuitmaker documentation standards

Each separate page of circuitmaker output diagram should have your name, section, and the name of the lab (Majority in this case) in the upper left-hand corner.

You will hand in:

  1. A copy of a complete truth table for the majority function, showing what output is given for each of the possible combinations of inputs.
  2. A printout of your circuit
  3. A debugging diary, describing your adventures in getting the circuit to work.
  4. A grading cover sheet.
  5. In addition to the hard copy mentioned above, email your <username>_majority.ckt file to me at croyden@mathcs.holycross.edu