# COUNT3 # Count number number of ones in the input. # Input length: 3 : x1, x2, x3 # Output length: 2 : y1, y2 GATE("x1", type="inp") GATE("x2", type="inp") GATE("x3", type="inp") GATE("y1", type="out") GATE("y2", type="out") GATE("g1", type="and2") GATE("g2", type="and2") GATE("g3", type="xor2") GATE("g4", type="xor2") GATE("g5", type="or2") WIRE("x1", "g1/x1") WIRE("x1", "g3/x1") WIRE("x2", "g1/x2") WIRE("x2", "g3/x2") WIRE("x3", "g2/x1") WIRE("x3", "g4/x2") WIRE("g1/y", "g5/x1") WIRE("g2/y", "g5/x2") WIRE("g4/y", "y2") WIRE("g3/y", "g2/x2") WIRE("g3/y", "g4/x1") WIRE("g5/y", "y1")