X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2Fcomponents%2FGUIinc12.java;h=cbd1f9f036ed5d98c276dedb1ec7978a5c7c62c3;hb=04801b6a8f9589855e8f9d8586e033088aa9ed3b;hp=0b94583c2be5e4f42b3afc0566c55198a05a535b;hpb=c9cca272f312bdea6cf661e861508fca2431a9d2;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIinc12.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIinc12.java index 0b94583c..cbd1f9f0 100644 --- a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIinc12.java +++ b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIinc12.java @@ -1,6 +1,5 @@ package net.mograsim.logic.model.am2900.components; -import static net.mograsim.logic.core.types.Bit.ONE; import static net.mograsim.logic.core.types.Bit.U; import static net.mograsim.logic.core.types.Bit.X; import static net.mograsim.logic.core.types.Bit.Z; @@ -51,19 +50,8 @@ public class GUIinc12 extends SimpleRectangularHardcodedGUIComponent for (int i = 11; i >= 0; i--) { Bit a = ABits[i]; - Bit z; - if (a.isBinary() && carry.isBinary()) - { - boolean aBool = a == ONE; - boolean carryBool = carry == ONE; - z = aBool ^ carryBool ? ONE : ZERO; - carry = aBool && carryBool ? ONE : ZERO; - } else - { - carry = carry.join(a); - z = carry; - } - YBits[i] = z; + YBits[i] = a.xor(carry); + carry = a.and(carry); } } readWriteEnds.get("Y").feedSignals(YBits);