def expl(sub, decimal): yield alu.sub.eq(sub) yield alu.decimal.eq(decimal) yield Settle() r = yield alu.r no = yield alu.no vo = yield alu.vo co = yield alu.co zo = yield alu.zo return' %02x.%c%c%c%c' % (r, 'N' if no else '-', 'V' if vo else '-', 'C' if co else '-', 'Z' if zo else '-') def clocking_proc(): for i in range(0x20000): r = '%02d %02x %c' % (i & 0xff, (i >> 8) & 0xff, 'C' if i & 0x10000 else '-') yield alu.i1.eq(i & 0xff) yield alu.i2.eq(i >> 8) yield alu.ci.eq(i >> 16) r += expl(0, 0) r += expl(0, 1) r += expl(1, 0) r += expl(1, 1) print(r) sys.exit(0)