+ def handle_carry(self, inputs, outputs):
+ inv_a = yield self.dec2.invert_a
+ if inv_a:
+ inputs[0] = ~inputs[0]
+ assert len(outputs) >= 1
+ output = outputs[0]
+ gts = [(x > output) == SelectableInt(1, 1) for x in inputs]
+ print(gts)
+ if all(gts):
+ return True
+ return False
+
+ def handle_comparison(self, outputs):
+ out = outputs[0]
+ out = exts(out.value, out.bits)
+ zero = SelectableInt(out == 0, 1)
+ positive = SelectableInt(out > 0, 1)
+ negative = SelectableInt(out < 0, 1)
+ SO = SelectableInt(0, 1)
+ cr_field = selectconcat(negative, positive, zero, SO)
+ self.crl[0].eq(cr_field)
+
+