# CELL: HAM # This cell is using the FOO cell which we defined earlier # XOR3 is basic type in PyCirc, so no need to load it GATE("x<1:4>", type="inp") GATE("y<1:3>", type="out") GATE("g1; g2", type="foo") # Here we define two gates g1 and g2 of type FOO !! GATE("g4", type="not") GATE("g3; g5", type="xor3") WIRE("x1", "g1/x1") WIRE("x2", "g1/x3") WIRE("x3", "g1/x2; g2/x1") WIRE("x4", "g2/x2; g2/x3") WIRE("g1/y1", "g3/x2") WIRE("g1/y2", "g3/x1; g4/x; g5/x1") WIRE("g2/y1", "g5/x2") WIRE("g2/y2", "g3/x3; g5/x3") WIRE("g3/y", "y1") WIRE("g4/y", "y2") WIRE("g5/y", "y3")