def PC(in_, load, inc, reset): "16-bit counter with load and reset controls." out_ = deferred_wires(16) choice1 = gates.mux16(out_, arithmetic.inc16(out_), inc) choice2 = gates.mux16(choice1, in_, load) choice3 = gates.mux16(choice2, (lo, ) * 16, reset) return resolve(out_, register(choice3, hi))
def PC(in_, load, inc, reset): "16-bit counter with load and reset controls." out_ = deferred_wires(16) choice1 = gates.mux16(out_, arithmetic.inc16(out_), inc) choice2 = gates.mux16(choice1, in_, load) choice3 = gates.mux16(choice2, (lo,) * 16, reset) return resolve(out_, register(choice3, hi))
def test_inc16(): exhaustive_test(inc16, lambda *in_: A.inc16(in_), 16)