P3: Exactly two ones

Published

February 20, 2026

Due
2026-02-25T23:59

Goals

  • Get practice building novel circuits

Objective

Construct a circuit with 4 inputs that outputs a 1 if exactly two of the four inputs is 1 and 0 otherwise.

Requirements

  • your work must be in a file called two_ones.circ
  • your implementation must be in the main circuit (this would be the default)
  • your circuit must have four inputs, labeled A,B,C, and D
  • your circuit must have one output labeled TWO_ONES
  • you are restricted to
    • input pins
    • output pins
    • components in the Gates library (i.e., basic logic gates)

Submission

Upload your .circ file to Gradescope.