Merge branch 'development' of https://gitlab.lrz.de/lrr-tum/students/eragp-misim...
authorFabian Stemmler <stemmler@in.tum.de>
Tue, 18 Jun 2019 19:40:59 +0000 (21:40 +0200)
committerFabian Stemmler <stemmler@in.tum.de>
Tue, 18 Jun 2019 19:40:59 +0000 (21:40 +0200)
20 files changed:
net.mograsim.logic.ui/FullAdder.json
net.mograsim.logic.ui/HalfAdder.json
net.mograsim.logic.ui/META-INF/MANIFEST.MF
net.mograsim.logic.ui/Test.json
net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/examples/SubmodelComponentTestbench.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/AtomicAm2901NANDBased.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIBitDisplay.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUICustomComponentCreator.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SimpleRectangularGUIGate.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SimpleRectangularSubmodelComponent.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponent.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponentParams.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIram4.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901ALUFuncDecode.java [new file with mode: 0644]
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901ALUInclDecode.java [new file with mode: 0644]
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/wires/MovablePin.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/wires/Pin.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/wires/WireCrossPoint.java

index 782652d..b24145f 100644 (file)
@@ -9,6 +9,7 @@ mograsim version: 0.1.0
         "x": 0.0,
         "y": 5.0
       },
+      "name": "Input pin #0",
       "logicWidth": 1
     },
     {
@@ -16,6 +17,7 @@ mograsim version: 0.1.0
         "x": 0.0,
         "y": 15.0
       },
+      "name": "Input pin #1",
       "logicWidth": 1
     },
     {
@@ -23,6 +25,7 @@ mograsim version: 0.1.0
         "x": 0.0,
         "y": 25.0
       },
+      "name": "Input pin #2",
       "logicWidth": 1
     },
     {
@@ -30,6 +33,7 @@ mograsim version: 0.1.0
         "x": 35.0,
         "y": 5.0
       },
+      "name": "Output pin #0",
       "logicWidth": 1
     },
     {
@@ -37,6 +41,7 @@ mograsim version: 0.1.0
         "x": 35.0,
         "y": 15.0
       },
+      "name": "Output pin #1",
       "logicWidth": 1
     }
   ],
index 802ba0d..b1e8f85 100644 (file)
@@ -9,6 +9,7 @@ mograsim version: 0.1.0
         "x": 0.0,
         "y": 5.0
       },
+      "name": "A",
       "logicWidth": 1
     },
     {
@@ -16,6 +17,7 @@ mograsim version: 0.1.0
         "x": 0.0,
         "y": 15.0
       },
+      "name": "B",
       "logicWidth": 1
     },
     {
@@ -23,6 +25,7 @@ mograsim version: 0.1.0
         "x": 35.0,
         "y": 5.0
       },
+      "name": "Y",
       "logicWidth": 1
     },
     {
@@ -30,6 +33,7 @@ mograsim version: 0.1.0
         "x": 35.0,
         "y": 15.0
       },
+      "name": "Z",
       "logicWidth": 1
     }
   ],
index 3bfa20a..5ac4cfb 100644 (file)
@@ -7,9 +7,12 @@ Export-Package: net.mograsim.logic.ui,
  net.mograsim.logic.ui.examples,
  net.mograsim.logic.ui.model,
  net.mograsim.logic.ui.model.components,
+ net.mograsim.logic.ui.model.components.mi.nandbased,
+ net.mograsim.logic.ui.model.components.mi.nandbased.am2901,
  net.mograsim.logic.ui.model.wires,
  net.mograsim.logic.ui.modeladapter,
- net.mograsim.logic.ui.modeladapter.componentadapters
+ net.mograsim.logic.ui.modeladapter.componentadapters,
+ net.mograsim.logic.ui.util
 Bundle-RequiredExecutionEnvironment: JavaSE-10
 Require-Bundle: org.eclipse.swt;bundle-version="3.110.0",
  SWTZoomableCanvas;bundle-version="1.0.0";visibility:=reexport,
index 36e1ca9..651205a 100644 (file)
@@ -9,6 +9,7 @@ mograsim version: 0.1.0
         "x": 0.0,
         "y": 5.0
       },
+      "name": "Input pin #0",
       "logicWidth": 1
     }
   ],
index 04d0f25..29bf613 100644 (file)
@@ -22,6 +22,7 @@ public class LogicUIRenderer
 
        public void render(GeneralGC gc, Rectangle visibleRegion)
        {
+               gc.setAntialias(SWT.ON);
                gc.setClipping(visibleRegion);
                gc.setLineWidth(.5);
                model.getWires().forEach(w ->
index b3fb717..681b3b3 100644 (file)
@@ -5,7 +5,7 @@ import net.mograsim.logic.ui.model.ViewModelModifiable;
 import net.mograsim.logic.ui.model.components.GUIBitDisplay;
 import net.mograsim.logic.ui.model.components.GUIManualSwitch;
 import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
-import net.mograsim.logic.ui.model.components.mi.nandbased.am2901.GUIAm2901ALUOneBit;
+import net.mograsim.logic.ui.model.components.mi.nandbased.am2901.GUIAm2901ALUInclDecode;
 import net.mograsim.logic.ui.model.wires.GUIWire;
 
 public class SubmodelComponentTestbench
@@ -18,7 +18,7 @@ public class SubmodelComponentTestbench
        @SuppressWarnings("unused") // for GUIWires being created
        public static void createTestbench(ViewModelModifiable model)
        {
-               SimpleRectangularSubmodelComponent comp = new GUIAm2901ALUOneBit(model);
+               SimpleRectangularSubmodelComponent comp = new GUIAm2901ALUInclDecode(model);
 
                comp.moveTo(100, 0);
                for (int i = 0; i < comp.getInputPins().size(); i++)
index 1658753..b74f733 100644 (file)
@@ -9,7 +9,6 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.ui.model.ViewModelModifiable;
 import net.mograsim.logic.ui.model.wires.Pin;
 
-// TODO make a superclass
 public class AtomicAm2901NANDBased extends GUIComponent
 {
        public final List<String> inputNames;
@@ -24,9 +23,9 @@ public class AtomicAm2901NANDBased extends GUIComponent
                this.outputNames = List.of("Y1", "Y2", "Y3", "Y4", "F=0", "Cn+4", "OVR", "F3_ORAMn+3", "ORAMn", "OQn", "OQn+3");
                setSize(50, inputNames.size() * 10);
                for (int i = 0; i < inputNames.size(); i++)
-                       addPin(new Pin(this, 1, 0, 5 + 10 * i));
+                       addPin(new Pin(this, "Input pin #" + i, 1, 0, 5 + 10 * i));
                for (int i = 0; i < outputNames.size(); i++)
-                       addPin(new Pin(this, 1, 50, 5 + 10 * i));
+                       addPin(new Pin(this, "Output pin #" + i, 1, 50, 5 + 10 * i));
        }
 
        @Override
index ec397c0..82399c1 100644 (file)
@@ -28,7 +28,7 @@ public class GUIBitDisplay extends GUIComponent
                logicObs = (i) -> requestRedraw();
 
                setSize(width, height);
-               addPin(this.inputPin = new Pin(this, 1, 0, height / 2));
+               addPin(this.inputPin = new Pin(this, "", 1, 0, height / 2));
        }
 
        @Override
index ea45b61..2f3e405 100644 (file)
@@ -100,7 +100,7 @@ public final class GUICustomComponentCreator
                comp.setSize(params.width, params.height);
                for (InterfacePinParams iPinParams : params.interfacePins)
                {
-                       comp.addSubmodelInterface(iPinParams.logicWidth, iPinParams.location.x, iPinParams.location.y);
+                       comp.addSubmodelInterface(iPinParams.name, iPinParams.logicWidth, iPinParams.location.x, iPinParams.location.y);
                }
                return comp;
        }
index 8b9bcd9..0342350 100644 (file)
@@ -30,7 +30,7 @@ public class GUIManualSwitch extends GUIComponent
                logicObs = (i) -> requestRedraw();
 
                setSize(width, height);
-               addPin(this.outputPin = new Pin(this, 1, width, height / 2));
+               addPin(this.outputPin = new Pin(this, "", 1, width, height / 2));
        }
 
        @Override
index aae03d2..cbb8ab7 100644 (file)
@@ -35,7 +35,7 @@ public class SimpleRectangularGUIGate extends GUIComponent
                this.logicWidth = logicWidth;
                this.isInverted = isInverted;
                this.rectWidth = width - (isInverted ? invertedCircleDiam : 0);
-               this.outputPin = new MovablePin(this, logicWidth, width, 0);
+               this.outputPin = new MovablePin(this, "Y", logicWidth, width, 0);
                addPin(outputPin);
                this.inputPins = new ArrayList<>();
                this.inputPinsUnmodifiable = Collections.unmodifiableList(inputPins);
@@ -52,7 +52,8 @@ public class SimpleRectangularGUIGate extends GUIComponent
                else if (oldInputCount < inputCount)
                        for (int i = oldInputCount; i < inputCount; i++)
                        {
-                               Pin pin = new Pin(this, logicWidth, 0, pinDistance / 2 + i * pinDistance);
+                               // TODO what for more than 26 input pins?
+                               Pin pin = new Pin(this, "A" + i, logicWidth, 0, pinDistance / 2 + i * pinDistance);
                                inputPins.add(pin);
                                addPin(pin);
                        }
index 51e5b28..44b402d 100644 (file)
@@ -62,7 +62,8 @@ public class SimpleRectangularSubmodelComponent extends SubmodelComponent
                else if (oldInputCount < inputCount)
                        for (int i = oldInputCount; i < inputCount; i++)
                        {
-                               Pin submodelPin = addSubmodelInterface(logicWidth, 0, pinDistance / 2 + i * pinDistance);
+                               // TODO pin names
+                               Pin submodelPin = addSubmodelInterface("Input pin #" + i, logicWidth, 0, pinDistance / 2 + i * pinDistance);
                                inputSubmodelPins.add(submodelPin);
                                inputSupermodelPins.add(getSupermodelPin(submodelPin));
                        }
@@ -81,7 +82,8 @@ public class SimpleRectangularSubmodelComponent extends SubmodelComponent
                else if (oldOutputCount < outputCount)
                        for (int i = oldOutputCount; i < outputCount; i++)
                        {
-                               Pin submodelPin = addSubmodelInterface(logicWidth, width, pinDistance / 2 + i * pinDistance);
+                               // TODO pin names
+                               Pin submodelPin = addSubmodelInterface("Output pin #" + i, logicWidth, width, pinDistance / 2 + i * pinDistance);
                                outputSubmodelPins.add(submodelPin);
                                outputSupermodelPins.add(getSupermodelPin(submodelPin));
                        }
@@ -119,6 +121,7 @@ public class SimpleRectangularSubmodelComponent extends SubmodelComponent
                Point textExtent = gc.textExtent(label);
                gc.drawText(label, posX + (getBounds().width - textExtent.x) / 2, posY + (getBounds().height - textExtent.y) / 2, true);
                gc.setFont(oldFont);
+               // TODO draw pin names
        }
 
        @Override
index 16c8c2a..9fa933b 100644 (file)
@@ -21,15 +21,16 @@ import net.mograsim.logic.ui.model.components.SubmodelComponentParams.InnerPinPa
 import net.mograsim.logic.ui.model.components.SubmodelComponentParams.InnerWireParams;
 import net.mograsim.logic.ui.model.components.SubmodelComponentParams.InterfacePinParams;
 import net.mograsim.logic.ui.model.wires.GUIWire;
+import net.mograsim.logic.ui.model.wires.MovablePin;
 import net.mograsim.logic.ui.model.wires.Pin;
 
 public abstract class SubmodelComponent extends GUIComponent
 {
        protected final ViewModelModifiable submodelModifiable;
        public final ViewModel submodel;
-       private final Map<PinMovable, PinMovable> submodelPinsPerSupermodelPin;
+       private final Map<MovablePin, MovablePin> submodelPinsPerSupermodelPin;
        private final Map<Pin, Pin> submodelPinsPerSupermodelPinUnmodifiable;
-       private final Map<PinMovable, PinMovable> supermodelPinsPerSubmodelPin;
+       private final Map<MovablePin, MovablePin> supermodelPinsPerSubmodelPin;
        private final Map<Pin, Pin> supermodelPinsPerSubmodelPinUnmodifiable;
        private final SubmodelInterface submodelInterface;
 
@@ -61,7 +62,7 @@ public abstract class SubmodelComponent extends GUIComponent
        {
                this.submodelScale = submodelScale;
 
-               for (Entry<PinMovable, PinMovable> e : supermodelPinsPerSubmodelPin.entrySet())
+               for (Entry<MovablePin, MovablePin> e : supermodelPinsPerSubmodelPin.entrySet())
                        e.getKey().setRelPos(e.getValue().getRelX() * submodelScale, e.getValue().getRelY() * submodelScale);
 
                requestRedraw();// needed if there is no submodel interface pin
@@ -75,12 +76,12 @@ public abstract class SubmodelComponent extends GUIComponent
        /**
         * Returns the submodel pin.
         */
-       protected Pin addSubmodelInterface(int logicWidth, double relX, double relY)
+       protected Pin addSubmodelInterface(String name, int logicWidth, double relX, double relY)
        {
-               PinMovable submodelPin = new PinMovable(submodelInterface, logicWidth, relX / submodelScale, relY / submodelScale);
+               MovablePin submodelPin = new MovablePin(submodelInterface, name, logicWidth, relX / submodelScale, relY / submodelScale);
                submodelInterface.addPin(submodelPin);
 
-               PinMovable supermodelPin = new PinMovable(this, logicWidth, relX, relY);
+               MovablePin supermodelPin = new MovablePin(this, name, logicWidth, relX, relY);
                addPin(supermodelPin);
 
                submodelPinsPerSupermodelPin.put(supermodelPin, submodelPin);
@@ -92,8 +93,8 @@ public abstract class SubmodelComponent extends GUIComponent
 
        protected void moveSubmodelInterface(Pin supermodelPin, double relX, double relY)
        {
-               PinMovable submodelPin = getSubmodelMovablePin(supermodelPin);
-               PinMovable supermodelPinMovable = getSupermodelMovablePin(submodelPin);
+               MovablePin submodelPin = getSubmodelMovablePin(supermodelPin);
+               MovablePin supermodelPinMovable = getSupermodelMovablePin(submodelPin);
 
                submodelPin.setRelPos(relX / submodelScale, relY / submodelScale);
                supermodelPinMovable.setRelPos(relX, relY);
@@ -123,7 +124,7 @@ public abstract class SubmodelComponent extends GUIComponent
                return getSupermodelMovablePin(submodelPin);
        }
 
-       protected PinMovable getSupermodelMovablePin(Pin submodelPin)
+       protected MovablePin getSupermodelMovablePin(Pin submodelPin)
        {
                return supermodelPinsPerSubmodelPin.get(submodelPin);
        }
@@ -138,7 +139,7 @@ public abstract class SubmodelComponent extends GUIComponent
                return getSubmodelMovablePin(supermodelPin);
        }
 
-       protected PinMovable getSubmodelMovablePin(Pin supermodelPin)
+       protected MovablePin getSubmodelMovablePin(Pin supermodelPin)
        {
                return submodelPinsPerSupermodelPin.get(supermodelPin);
        }
@@ -195,20 +196,6 @@ public abstract class SubmodelComponent extends GUIComponent
                return true;
        }
 
-       private static class PinMovable extends Pin
-       {
-               public PinMovable(GUIComponent component, int logicWidth, double relX, double relY)
-               {
-                       super(component, logicWidth, relX, relY);
-               }
-
-               @Override
-               protected void setRelPos(double relX, double relY)
-               {
-                       super.setRelPos(relX, relY);
-               }
-       }
-
        /**
         * @return {@link SubmodelComponentParams}, which describe this {@link SubmodelComponent}.
         */
@@ -230,6 +217,7 @@ public abstract class SubmodelComponent extends GUIComponent
                        InterfacePinParams iPinParams = new InterfacePinParams();
                        iPins[i] = iPinParams;
                        iPinParams.location = p.getRelPos();
+                       iPinParams.name = p.name;
                        iPinParams.logicWidth = p.logicWidth;
                        i++;
                }
index 5fd7ab5..f240355 100644 (file)
@@ -20,6 +20,7 @@ public class SubmodelComponentParams
        public static class InterfacePinParams
        {
                public Point location;
+               public String name;
                public int logicWidth;
        }
 
index 02dc9c3..699f13e 100644 (file)
@@ -51,14 +51,14 @@ public class GUIram4 extends SimpleRectangularSubmodelComponent
                GUIram2     cell01   = new GUIram2    (submodelModifiable);
                GUIram2     cell10   = new GUIram2    (submodelModifiable);
                GUIram2     cell11   = new GUIram2    (submodelModifiable);
-               GUIand41    andA00   = new GUIand41   (submodelModifiable);
-               GUIandor414 andorA01 = new GUIandor414(submodelModifiable);
-               GUIandor414 andorA10 = new GUIandor414(submodelModifiable);
-               GUIandor414 andorA11 = new GUIandor414(submodelModifiable);
                GUIand41    andB00   = new GUIand41   (submodelModifiable);
                GUIandor414 andorB01 = new GUIandor414(submodelModifiable);
                GUIandor414 andorB10 = new GUIandor414(submodelModifiable);
                GUIandor414 andorB11 = new GUIandor414(submodelModifiable);
+               GUIand41    andA00   = new GUIand41   (submodelModifiable);
+               GUIandor414 andorA01 = new GUIandor414(submodelModifiable);
+               GUIandor414 andorA10 = new GUIandor414(submodelModifiable);
+               GUIandor414 andorA11 = new GUIandor414(submodelModifiable);
 
                WireCrossPoint cpB00  = new WireCrossPoint(submodelModifiable, 1);
                WireCrossPoint cpB01  = new WireCrossPoint(submodelModifiable, 1);
@@ -86,82 +86,52 @@ public class GUIram4 extends SimpleRectangularSubmodelComponent
                WireCrossPoint cpAB410 = new WireCrossPoint(submodelModifiable, 1);
                WireCrossPoint cpAB1in = new WireCrossPoint(submodelModifiable, 1);
                WireCrossPoint cpAB2in = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpAB3in = new WireCrossPoint(submodelModifiable, 1);
                WireCrossPoint cpAB4in = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ100 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ200 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ300 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ400 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ101 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ201 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ301 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ401 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ110 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ210 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ310 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ410 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ111 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ211 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ311 = new WireCrossPoint(submodelModifiable, 1);
-               WireCrossPoint cpQ411 = new WireCrossPoint(submodelModifiable, 1);
 
                demuxA  .moveTo( 55,  45);
                demuxB  .moveTo( 55, 150);
-               weAndB  .moveTo(150, 150);
-               cell00  .moveTo( 75, 325);
-               cell01  .moveTo( 75, 475);
-               cell10  .moveTo( 75, 625);
-               cell11  .moveTo( 75, 775);
-               andA00  .moveTo(250, 375);
-               andorA01.moveTo(250, 485);
-               andorA10.moveTo(250, 635);
-               andorA11.moveTo(250, 785);
-               andB00  .moveTo(155, 325);
-               andorB01.moveTo(155, 435);
-               andorB10.moveTo(155, 585);
-               andorB11.moveTo(155, 735);
-               cpB00 .moveCenterTo(130, 155);
-               cpB01 .moveCenterTo(125, 165);
-               cpB10 .moveCenterTo(120, 175);
-               cpB11 .moveCenterTo(115, 185);
-               cpD_101.moveCenterTo( 62.5, 530);
-               cpD_201.moveCenterTo( 65  , 540);
-               cpD_301.moveCenterTo( 67.5, 550);
-               cpD_401.moveCenterTo( 70  , 560);
-               cpD_110.moveCenterTo( 62.5, 680);
-               cpD_210.moveCenterTo( 65  , 690);
-               cpD_310.moveCenterTo( 67.5, 700);
-               cpD_410.moveCenterTo( 70  , 710);
-               cpD_111.moveCenterTo( 62.5, 830);
-               cpD_211.moveCenterTo( 65  , 840);
-               cpD_311.moveCenterTo( 67.5, 850);
-               cpD_411.moveCenterTo( 70  , 860);
-               cpAB101.moveCenterTo( 40, 480);
-               cpAB201.moveCenterTo( 45, 490);
-               cpAB301.moveCenterTo( 50, 500);
-               cpAB401.moveCenterTo( 55, 510);
-               cpAB110.moveCenterTo( 40, 630);
-               cpAB210.moveCenterTo( 45, 640);
-               cpAB310.moveCenterTo( 50, 650);
-               cpAB410.moveCenterTo( 55, 660);
-               cpAB1in.moveCenterTo( 40, 330);
+               weAndB  .moveTo(235, 150);
+               cell00  .moveTo( 80, 330);
+               cell01  .moveTo( 80, 480);
+               cell10  .moveTo( 80, 630);
+               cell11  .moveTo( 80, 780);
+               andB00  .moveTo(250, 375);
+               andorB01.moveTo(250, 485);
+               andorB10.moveTo(250, 635);
+               andorB11.moveTo(250, 785);
+               andA00  .moveTo(155, 325);
+               andorA01.moveTo(155, 435);
+               andorA10.moveTo(155, 585);
+               andorA11.moveTo(155, 735);
+               cpB00 .moveCenterTo(230, 155);
+               cpB01 .moveCenterTo(225, 165);
+               cpB10 .moveCenterTo(220, 175);
+               cpB11 .moveCenterTo(215, 185);
+               cpD_101.moveCenterTo( 60, 535);
+               cpD_201.moveCenterTo( 65, 545);
+               cpD_301.moveCenterTo( 70, 555);
+               cpD_401.moveCenterTo( 75, 565);
+               cpD_110.moveCenterTo( 60, 685);
+               cpD_210.moveCenterTo( 65, 695);
+               cpD_310.moveCenterTo( 70, 705);
+               cpD_410.moveCenterTo( 75, 715);
+               cpD_111.moveCenterTo( 60, 835);
+               cpD_211.moveCenterTo( 65, 845);
+               cpD_311.moveCenterTo( 70, 855);
+               cpD_411.moveCenterTo( 75, 865);
+               cpAB101.moveCenterTo( 40, 485);
+               cpAB201.moveCenterTo( 45, 495);
+               cpAB301.moveCenterTo( 50, 505);
+               cpAB401.moveCenterTo( 55, 515);
+               cpAB110.moveCenterTo( 40, 635);
+               cpAB210.moveCenterTo( 45, 645);
+               cpAB310.moveCenterTo( 50, 655);
+               cpAB410.moveCenterTo( 55, 665);
+               cpAB1in.moveCenterTo( 40, 335);
                cpAB2in.moveCenterTo( 45, 350);
+               cpAB3in.moveCenterTo( 50, 650);
                cpAB4in.moveCenterTo( 55, 750);
-               cpQ100.moveCenterTo(150, 330);
-               cpQ200.moveCenterTo(145, 340);
-               cpQ300.moveCenterTo(140, 350);
-               cpQ400.moveCenterTo(135, 360);
-               cpQ101.moveCenterTo(150, 480);
-               cpQ201.moveCenterTo(145, 490);
-               cpQ301.moveCenterTo(140, 500);
-               cpQ401.moveCenterTo(135, 510);
-               cpQ110.moveCenterTo(150, 630);
-               cpQ210.moveCenterTo(145, 640);
-               cpQ310.moveCenterTo(140, 650);
-               cpQ410.moveCenterTo(135, 660);
-               cpQ111.moveCenterTo(150, 780);
-               cpQ211.moveCenterTo(145, 790);
-               cpQ311.moveCenterTo(140, 800);
-               cpQ411.moveCenterTo(135, 810);
 
                new GUIWire(submodelModifiable, A0, demuxA.getInputPins().get(0), new Point[0]);
                new GUIWire(submodelModifiable, A1, demuxA.getInputPins().get(1), new Point(10, 150), new Point(10,  60));
@@ -176,41 +146,42 @@ public class GUIram4 extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, cpB10, weAndB.getInputPins().get(2), new Point[0]);
                new GUIWire(submodelModifiable, cpB11, weAndB.getInputPins().get(3), new Point[0]);
                new GUIWire(submodelModifiable, WE, weAndB.getInputPins().get(4), new Point(15, 850), new Point(15, 195));
-               new GUIWire(submodelModifiable, weAndB.getOutputPins().get(0), cell00.getInputPins().get(4), new Point(205, 155), new Point(205, 230), new Point(35, 230), new Point(35, 370));
-               new GUIWire(submodelModifiable, weAndB.getOutputPins().get(1), cell01.getInputPins().get(4), new Point(200, 165), new Point(200, 225), new Point(30, 225), new Point(30, 520));
-               new GUIWire(submodelModifiable, weAndB.getOutputPins().get(2), cell10.getInputPins().get(4), new Point(195, 175), new Point(195, 220), new Point(25, 220), new Point(25, 670));
-               new GUIWire(submodelModifiable, weAndB.getOutputPins().get(3), cell11.getInputPins().get(4), new Point(190, 185), new Point(190, 215), new Point(20, 215), new Point(20, 820));
+               new GUIWire(submodelModifiable, weAndB.getOutputPins().get(0), cell00.getInputPins().get(4), new Point(290, 155), new Point(290, 230), new Point(35, 230), new Point(35, 375));
+               new GUIWire(submodelModifiable, weAndB.getOutputPins().get(1), cell01.getInputPins().get(4), new Point(285, 165), new Point(285, 225), new Point(30, 225), new Point(30, 525));
+               new GUIWire(submodelModifiable, weAndB.getOutputPins().get(2), cell10.getInputPins().get(4), new Point(280, 175), new Point(280, 220), new Point(25, 220), new Point(25, 675));
+               new GUIWire(submodelModifiable, weAndB.getOutputPins().get(3), cell11.getInputPins().get(4), new Point(275, 185), new Point(275, 215), new Point(20, 215), new Point(20, 825));
                new GUIWire(submodelModifiable, cpAB101, cpAB1in                     , new Point[0]);
                new GUIWire(submodelModifiable, cpAB1in, cell00.getInputPins().get(0), new Point[0]);
                new GUIWire(submodelModifiable, cpAB201, cpAB2in                     , new Point[0]);
-               new GUIWire(submodelModifiable, cpAB2in, cell00.getInputPins().get(1), new Point(45, 340));
-               new GUIWire(submodelModifiable, cpAB301, cell00.getInputPins().get(2), new Point(50, 350));
-               new GUIWire(submodelModifiable, cpAB401, cell00.getInputPins().get(3), new Point(55, 360));
+               new GUIWire(submodelModifiable, cpAB2in, cell00.getInputPins().get(1), new Point(45, 345));
+               new GUIWire(submodelModifiable, cpAB301, cell00.getInputPins().get(2), new Point(50, 355));
+               new GUIWire(submodelModifiable, cpAB401, cell00.getInputPins().get(3), new Point(55, 365));
                new GUIWire(submodelModifiable, cpAB101, cell01.getInputPins().get(0), new Point[0]);
                new GUIWire(submodelModifiable, cpAB201, cell01.getInputPins().get(1), new Point[0]);
                new GUIWire(submodelModifiable, cpAB301, cell01.getInputPins().get(2), new Point[0]);
                new GUIWire(submodelModifiable, cpAB401, cell01.getInputPins().get(3), new Point[0]);
                new GUIWire(submodelModifiable, cpAB101, cpAB110                      , new Point[0]);
                new GUIWire(submodelModifiable, cpAB201, cpAB210                      , new Point[0]);
-               new GUIWire(submodelModifiable, cpAB301, cpAB310                      , new Point[0]);
+               new GUIWire(submodelModifiable, cpAB301, cpAB3in                      , new Point[0]);
+               new GUIWire(submodelModifiable, B2, cpAB3in                          , new Point[0]);
+               new GUIWire(submodelModifiable, cpAB3in, cpAB310                      , new Point[0]);
                new GUIWire(submodelModifiable, cpAB401, cpAB410                      , new Point[0]);
                new GUIWire(submodelModifiable, cpAB110, cell10.getInputPins().get(0), new Point[0]);
                new GUIWire(submodelModifiable, cpAB210, cell10.getInputPins().get(1), new Point[0]);
                new GUIWire(submodelModifiable, cpAB310, cell10.getInputPins().get(2), new Point[0]);
                new GUIWire(submodelModifiable, cpAB410, cell10.getInputPins().get(3), new Point[0]);
-               new GUIWire(submodelModifiable, cpAB110, cell11.getInputPins().get(0), new Point(40, 780));
-               new GUIWire(submodelModifiable, cpAB210, cell11.getInputPins().get(1), new Point(45, 790));
-               new GUIWire(submodelModifiable, cpAB310, cell11.getInputPins().get(2), new Point(50, 800));
+               new GUIWire(submodelModifiable, cpAB110, cell11.getInputPins().get(0), new Point(40, 785));
+               new GUIWire(submodelModifiable, cpAB210, cell11.getInputPins().get(1), new Point(45, 795));
+               new GUIWire(submodelModifiable, cpAB310, cell11.getInputPins().get(2), new Point(50, 805));
                new GUIWire(submodelModifiable, cpAB410, cpAB4in                     , new Point[0]);
-               new GUIWire(submodelModifiable, cpAB4in, cell11.getInputPins().get(3), new Point(55, 810));
+               new GUIWire(submodelModifiable, cpAB4in, cell11.getInputPins().get(3), new Point(55, 815));
                new GUIWire(submodelModifiable, A2, cpAB1in                          , new Point(40, 250));
                new GUIWire(submodelModifiable, A3, cpAB2in                          , new Point[0]);
-               new GUIWire(submodelModifiable, B2, cpAB310                          , new Point[0]);
                new GUIWire(submodelModifiable, B3, cpAB4in                          , new Point[0]);
-               new GUIWire(submodelModifiable, cpD_101, cell00.getInputPins().get(5), new Point(62.5, 380));
-               new GUIWire(submodelModifiable, cpD_201, cell00.getInputPins().get(6), new Point(65  , 390));
-               new GUIWire(submodelModifiable, cpD_301, cell00.getInputPins().get(7), new Point(67.5, 400));
-               new GUIWire(submodelModifiable, cpD_401, cell00.getInputPins().get(8), new Point(70  , 410));
+               new GUIWire(submodelModifiable, cpD_101, cell00.getInputPins().get(5), new Point(60, 385));
+               new GUIWire(submodelModifiable, cpD_201, cell00.getInputPins().get(6), new Point(65, 395));
+               new GUIWire(submodelModifiable, cpD_301, cell00.getInputPins().get(7), new Point(70, 405));
+               new GUIWire(submodelModifiable, cpD_401, cell00.getInputPins().get(8), new Point(75, 415));
                new GUIWire(submodelModifiable, cpD_101, cell01.getInputPins().get(5), new Point[0]);
                new GUIWire(submodelModifiable, cpD_201, cell01.getInputPins().get(6), new Point[0]);
                new GUIWire(submodelModifiable, cpD_301, cell01.getInputPins().get(7), new Point[0]);
@@ -231,98 +202,82 @@ public class GUIram4 extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, cpD_211, cell11.getInputPins().get(6), new Point[0]);
                new GUIWire(submodelModifiable, cpD_311, cell11.getInputPins().get(7), new Point[0]);
                new GUIWire(submodelModifiable, cpD_411, cell11.getInputPins().get(8), new Point[0]);
-               new GUIWire(submodelModifiable, D1, cpD_111                          , new Point(62.5,  950));
-               new GUIWire(submodelModifiable, D2, cpD_211                          , new Point(65  , 1050));
-               new GUIWire(submodelModifiable, D3, cpD_311                          , new Point(67.5, 1150));
-               new GUIWire(submodelModifiable, D4, cpD_411                          , new Point(70  , 1250));
-               new GUIWire(submodelModifiable, cell00.getOutputPins().get(0), cpQ100, new Point[0]);
-               new GUIWire(submodelModifiable, cell00.getOutputPins().get(1), cpQ200, new Point[0]);
-               new GUIWire(submodelModifiable, cell00.getOutputPins().get(2), cpQ300, new Point[0]);
-               new GUIWire(submodelModifiable, cell00.getOutputPins().get(3), cpQ400, new Point[0]);
-               new GUIWire(submodelModifiable, cell01.getOutputPins().get(0), cpQ101, new Point[0]);
-               new GUIWire(submodelModifiable, cell01.getOutputPins().get(1), cpQ201, new Point[0]);
-               new GUIWire(submodelModifiable, cell01.getOutputPins().get(2), cpQ301, new Point[0]);
-               new GUIWire(submodelModifiable, cell01.getOutputPins().get(3), cpQ401, new Point[0]);
-               new GUIWire(submodelModifiable, cell10.getOutputPins().get(0), cpQ110, new Point[0]);
-               new GUIWire(submodelModifiable, cell10.getOutputPins().get(1), cpQ210, new Point[0]);
-               new GUIWire(submodelModifiable, cell10.getOutputPins().get(2), cpQ310, new Point[0]);
-               new GUIWire(submodelModifiable, cell10.getOutputPins().get(3), cpQ410, new Point[0]);
-               new GUIWire(submodelModifiable, cell11.getOutputPins().get(0), cpQ111, new Point[0]);
-               new GUIWire(submodelModifiable, cell11.getOutputPins().get(1), cpQ211, new Point[0]);
-               new GUIWire(submodelModifiable, cell11.getOutputPins().get(2), cpQ311, new Point[0]);
-               new GUIWire(submodelModifiable, cell11.getOutputPins().get(3), cpQ411, new Point[0]);
-               new GUIWire(submodelModifiable, demuxA.getOutputPins().get(0), andA00  .getInputPins().get(4), new Point(230, 50), new Point(230, 420));
-               new GUIWire(submodelModifiable, demuxA.getOutputPins().get(1), andorA01.getInputPins().get(8), new Point(225, 60), new Point(225, 570));
-               new GUIWire(submodelModifiable, demuxA.getOutputPins().get(2), andorA10.getInputPins().get(8), new Point(220, 70), new Point(220, 720));
-               new GUIWire(submodelModifiable, demuxA.getOutputPins().get(3), andorA11.getInputPins().get(8), new Point(215, 80), new Point(215, 870));
-               new GUIWire(submodelModifiable, cpB00 , andB00  .getInputPins().get(4), new Point(130, 370));
-               new GUIWire(submodelModifiable, cpB01 , andorB01.getInputPins().get(8), new Point(125, 520));
-               new GUIWire(submodelModifiable, cpB10 , andorB10.getInputPins().get(8), new Point(120, 670));
-               new GUIWire(submodelModifiable, cpB11 , andorB11.getInputPins().get(8), new Point(115, 820));
-               new GUIWire(submodelModifiable, cpQ100, andA00  .getInputPins().get(0), new Point(150, 380));
-               new GUIWire(submodelModifiable, cpQ200, andA00  .getInputPins().get(1), new Point(145, 390));
-               new GUIWire(submodelModifiable, cpQ300, andA00  .getInputPins().get(2), new Point(140, 400));
-               new GUIWire(submodelModifiable, cpQ400, andA00  .getInputPins().get(3), new Point(135, 410));
-               new GUIWire(submodelModifiable, cpQ101, andorA01.getInputPins().get(4), new Point(150, 530));
-               new GUIWire(submodelModifiable, cpQ201, andorA01.getInputPins().get(5), new Point(145, 540));
-               new GUIWire(submodelModifiable, cpQ301, andorA01.getInputPins().get(6), new Point(140, 550));
-               new GUIWire(submodelModifiable, cpQ401, andorA01.getInputPins().get(7), new Point(135, 560));
-               new GUIWire(submodelModifiable, cpQ110, andorA10.getInputPins().get(4), new Point(150, 680));
-               new GUIWire(submodelModifiable, cpQ210, andorA10.getInputPins().get(5), new Point(145, 690));
-               new GUIWire(submodelModifiable, cpQ310, andorA10.getInputPins().get(6), new Point(140, 700));
-               new GUIWire(submodelModifiable, cpQ410, andorA10.getInputPins().get(7), new Point(135, 710));
-               new GUIWire(submodelModifiable, cpQ111, andorA11.getInputPins().get(4), new Point(150, 830));
-               new GUIWire(submodelModifiable, cpQ211, andorA11.getInputPins().get(5), new Point(145, 840));
-               new GUIWire(submodelModifiable, cpQ311, andorA11.getInputPins().get(6), new Point(140, 850));
-               new GUIWire(submodelModifiable, cpQ411, andorA11.getInputPins().get(7), new Point(135, 860));
-               new GUIWire(submodelModifiable, cpQ100, andB00  .getInputPins().get(0), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ200, andB00  .getInputPins().get(1), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ300, andB00  .getInputPins().get(2), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ400, andB00  .getInputPins().get(3), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ101, andorB01.getInputPins().get(4), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ201, andorB01.getInputPins().get(5), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ301, andorB01.getInputPins().get(6), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ401, andorB01.getInputPins().get(7), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ110, andorB10.getInputPins().get(4), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ210, andorB10.getInputPins().get(5), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ310, andorB10.getInputPins().get(6), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ410, andorB10.getInputPins().get(7), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ111, andorB11.getInputPins().get(4), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ211, andorB11.getInputPins().get(5), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ311, andorB11.getInputPins().get(6), new Point[0]);
-               new GUIWire(submodelModifiable, cpQ411, andorB11.getInputPins().get(7), new Point[0]);
-               new GUIWire(submodelModifiable, andA00  .getOutputPins().get(0), andorA01.getInputPins().get(0), new Point(305, 380), new Point(305, 445), new Point(245, 445), new Point(245, 490));
-               new GUIWire(submodelModifiable, andA00  .getOutputPins().get(1), andorA01.getInputPins().get(1), new Point(300, 390), new Point(300, 440), new Point(240, 440), new Point(240, 500));
-               new GUIWire(submodelModifiable, andA00  .getOutputPins().get(2), andorA01.getInputPins().get(2), new Point(295, 400), new Point(295, 435), new Point(235, 435), new Point(235, 510));
-               new GUIWire(submodelModifiable, andA00  .getOutputPins().get(3), andorA01.getInputPins().get(3), new Point(290, 410), new Point(290, 430), new Point(230, 430), new Point(230, 520));
-               new GUIWire(submodelModifiable, andorA01.getOutputPins().get(0), andorA10.getInputPins().get(0), new Point(305, 490), new Point(305, 595), new Point(245, 595), new Point(245, 640));
-               new GUIWire(submodelModifiable, andorA01.getOutputPins().get(1), andorA10.getInputPins().get(1), new Point(300, 500), new Point(300, 590), new Point(240, 590), new Point(240, 650));
-               new GUIWire(submodelModifiable, andorA01.getOutputPins().get(2), andorA10.getInputPins().get(2), new Point(295, 510), new Point(295, 585), new Point(235, 585), new Point(235, 660));
-               new GUIWire(submodelModifiable, andorA01.getOutputPins().get(3), andorA10.getInputPins().get(3), new Point(290, 520), new Point(290, 580), new Point(230, 580), new Point(230, 670));
-               new GUIWire(submodelModifiable, andorA10.getOutputPins().get(0), andorA11.getInputPins().get(0), new Point(305, 640), new Point(305, 745), new Point(245, 745), new Point(245, 790));
-               new GUIWire(submodelModifiable, andorA10.getOutputPins().get(1), andorA11.getInputPins().get(1), new Point(300, 650), new Point(300, 740), new Point(240, 740), new Point(240, 800));
-               new GUIWire(submodelModifiable, andorA10.getOutputPins().get(2), andorA11.getInputPins().get(2), new Point(295, 660), new Point(295, 735), new Point(235, 735), new Point(235, 810));
-               new GUIWire(submodelModifiable, andorA10.getOutputPins().get(3), andorA11.getInputPins().get(3), new Point(290, 670), new Point(290, 730), new Point(230, 730), new Point(230, 820));
-               new GUIWire(submodelModifiable, andorA11.getOutputPins().get(0), QA1                           , new Point(310, 790), new Point(310,  50));
-               new GUIWire(submodelModifiable, andorA11.getOutputPins().get(1), QA2                           , new Point(315, 800), new Point(315, 150));
-               new GUIWire(submodelModifiable, andorA11.getOutputPins().get(2), QA3                           , new Point(320, 810), new Point(320, 250));
-               new GUIWire(submodelModifiable, andorA11.getOutputPins().get(3), QA4                           , new Point(325, 820), new Point(325, 350));
-               new GUIWire(submodelModifiable, andB00  .getOutputPins().get(0), andorB01.getInputPins().get(0), new Point(210, 330), new Point(210, 430), new Point(150, 430), new Point(150, 440));
-               new GUIWire(submodelModifiable, andB00  .getOutputPins().get(1), andorB01.getInputPins().get(1), new Point(205, 340), new Point(205, 425), new Point(145, 425), new Point(145, 450));
-               new GUIWire(submodelModifiable, andB00  .getOutputPins().get(2), andorB01.getInputPins().get(2), new Point(200, 350), new Point(200, 420), new Point(140, 420), new Point(140, 460));
-               new GUIWire(submodelModifiable, andB00  .getOutputPins().get(3), andorB01.getInputPins().get(3), new Point(195, 360), new Point(195, 415), new Point(135, 415), new Point(135, 470));
-               new GUIWire(submodelModifiable, andorB01.getOutputPins().get(0), andorB10.getInputPins().get(0), new Point(210, 440), new Point(210, 580), new Point(150, 580), new Point(150, 590));
-               new GUIWire(submodelModifiable, andorB01.getOutputPins().get(1), andorB10.getInputPins().get(1), new Point(205, 450), new Point(205, 575), new Point(145, 575), new Point(145, 600));
-               new GUIWire(submodelModifiable, andorB01.getOutputPins().get(2), andorB10.getInputPins().get(2), new Point(200, 460), new Point(200, 570), new Point(140, 570), new Point(140, 610));
-               new GUIWire(submodelModifiable, andorB01.getOutputPins().get(3), andorB10.getInputPins().get(3), new Point(195, 470), new Point(195, 565), new Point(135, 565), new Point(135, 620));
-               new GUIWire(submodelModifiable, andorB10.getOutputPins().get(0), andorB11.getInputPins().get(0), new Point(210, 590), new Point(210, 730), new Point(150, 730), new Point(150, 740));
-               new GUIWire(submodelModifiable, andorB10.getOutputPins().get(1), andorB11.getInputPins().get(1), new Point(205, 600), new Point(205, 725), new Point(145, 725), new Point(145, 750));
-               new GUIWire(submodelModifiable, andorB10.getOutputPins().get(2), andorB11.getInputPins().get(2), new Point(200, 610), new Point(200, 720), new Point(140, 720), new Point(140, 760));
-               new GUIWire(submodelModifiable, andorB10.getOutputPins().get(3), andorB11.getInputPins().get(3), new Point(195, 620), new Point(195, 715), new Point(135, 715), new Point(135, 770));
-               new GUIWire(submodelModifiable, andorB11.getOutputPins().get(0), QB1                           , new Point(210, 740), new Point(210, 880), new Point(330, 880), new Point(330, 450));
-               new GUIWire(submodelModifiable, andorB11.getOutputPins().get(1), QB2                           , new Point(205, 750), new Point(205, 885), new Point(335, 885), new Point(335, 550));
-               new GUIWire(submodelModifiable, andorB11.getOutputPins().get(2), QB3                           , new Point(200, 760), new Point(200, 890), new Point(340, 890), new Point(340, 650));
-               new GUIWire(submodelModifiable, andorB11.getOutputPins().get(3), QB4                           , new Point(195, 770), new Point(195, 895), new Point(345, 895), new Point(345, 750));
+               new GUIWire(submodelModifiable, D1, cpD_111                          , new Point(60,  950));
+               new GUIWire(submodelModifiable, D2, cpD_211                          , new Point(65, 1050));
+               new GUIWire(submodelModifiable, D3, cpD_311                          , new Point(70, 1150));
+               new GUIWire(submodelModifiable, D4, cpD_411                          , new Point(75, 1250));
+               new GUIWire(submodelModifiable, demuxA.getOutputPins().get(0), andA00  .getInputPins().get(4), new Point(135, 50), new Point(135, 370));
+               new GUIWire(submodelModifiable, demuxA.getOutputPins().get(1), andorA01.getInputPins().get(8), new Point(130, 60), new Point(130, 520));
+               new GUIWire(submodelModifiable, demuxA.getOutputPins().get(2), andorA10.getInputPins().get(8), new Point(125, 70), new Point(125, 670));
+               new GUIWire(submodelModifiable, demuxA.getOutputPins().get(3), andorA11.getInputPins().get(8), new Point(120, 80), new Point(120, 820));
+               new GUIWire(submodelModifiable, cpB00 , andB00  .getInputPins().get(4), new Point(230, 420));
+               new GUIWire(submodelModifiable, cpB01 , andorB01.getInputPins().get(8), new Point(225, 570));
+               new GUIWire(submodelModifiable, cpB10 , andorB10.getInputPins().get(8), new Point(220, 720));
+               new GUIWire(submodelModifiable, cpB11 , andorB11.getInputPins().get(8), new Point(215, 870));
+               new GUIWire(submodelModifiable, cell00.getOutputPins().get(4), andB00  .getInputPins().get(0), new Point(140, 375), new Point(140, 380));
+               new GUIWire(submodelModifiable, cell00.getOutputPins().get(5), andB00  .getInputPins().get(1), new Point(140, 385), new Point(140, 390));
+               new GUIWire(submodelModifiable, cell00.getOutputPins().get(6), andB00  .getInputPins().get(2), new Point(140, 395), new Point(140, 400));
+               new GUIWire(submodelModifiable, cell00.getOutputPins().get(7), andB00  .getInputPins().get(3), new Point(140, 405), new Point(140, 410));
+               new GUIWire(submodelModifiable, cell01.getOutputPins().get(4), andorB01.getInputPins().get(4), new Point(140, 525), new Point(140, 530));
+               new GUIWire(submodelModifiable, cell01.getOutputPins().get(5), andorB01.getInputPins().get(5), new Point(140, 535), new Point(140, 540));
+               new GUIWire(submodelModifiable, cell01.getOutputPins().get(6), andorB01.getInputPins().get(6), new Point(140, 545), new Point(140, 550));
+               new GUIWire(submodelModifiable, cell01.getOutputPins().get(7), andorB01.getInputPins().get(7), new Point(140, 555), new Point(140, 560));
+               new GUIWire(submodelModifiable, cell10.getOutputPins().get(4), andorB10.getInputPins().get(4), new Point(140, 675), new Point(140, 680));
+               new GUIWire(submodelModifiable, cell10.getOutputPins().get(5), andorB10.getInputPins().get(5), new Point(140, 685), new Point(140, 690));
+               new GUIWire(submodelModifiable, cell10.getOutputPins().get(6), andorB10.getInputPins().get(6), new Point(140, 695), new Point(140, 700));
+               new GUIWire(submodelModifiable, cell10.getOutputPins().get(7), andorB10.getInputPins().get(7), new Point(140, 705), new Point(140, 710));
+               new GUIWire(submodelModifiable, cell11.getOutputPins().get(4), andorB11.getInputPins().get(4), new Point(140, 825), new Point(140, 830));
+               new GUIWire(submodelModifiable, cell11.getOutputPins().get(5), andorB11.getInputPins().get(5), new Point(140, 835), new Point(140, 840));
+               new GUIWire(submodelModifiable, cell11.getOutputPins().get(6), andorB11.getInputPins().get(6), new Point(140, 845), new Point(140, 850));
+               new GUIWire(submodelModifiable, cell11.getOutputPins().get(7), andorB11.getInputPins().get(7), new Point(140, 855), new Point(140, 860));
+               new GUIWire(submodelModifiable, cell00.getOutputPins().get(0), andA00  .getInputPins().get(0), new Point(140, 335), new Point(140, 330));
+               new GUIWire(submodelModifiable, cell00.getOutputPins().get(1), andA00  .getInputPins().get(1), new Point(140, 345), new Point(140, 340));
+               new GUIWire(submodelModifiable, cell00.getOutputPins().get(2), andA00  .getInputPins().get(2), new Point(140, 355), new Point(140, 350));
+               new GUIWire(submodelModifiable, cell00.getOutputPins().get(3), andA00  .getInputPins().get(3), new Point(140, 365), new Point(140, 360));
+               new GUIWire(submodelModifiable, cell01.getOutputPins().get(0), andorA01.getInputPins().get(4), new Point(140, 485), new Point(140, 480));
+               new GUIWire(submodelModifiable, cell01.getOutputPins().get(1), andorA01.getInputPins().get(5), new Point(140, 495), new Point(140, 490));
+               new GUIWire(submodelModifiable, cell01.getOutputPins().get(2), andorA01.getInputPins().get(6), new Point(140, 505), new Point(140, 500));
+               new GUIWire(submodelModifiable, cell01.getOutputPins().get(3), andorA01.getInputPins().get(7), new Point(140, 515), new Point(140, 510));
+               new GUIWire(submodelModifiable, cell10.getOutputPins().get(0), andorA10.getInputPins().get(4), new Point(140, 635), new Point(140, 630));
+               new GUIWire(submodelModifiable, cell10.getOutputPins().get(1), andorA10.getInputPins().get(5), new Point(140, 645), new Point(140, 640));
+               new GUIWire(submodelModifiable, cell10.getOutputPins().get(2), andorA10.getInputPins().get(6), new Point(140, 655), new Point(140, 650));
+               new GUIWire(submodelModifiable, cell10.getOutputPins().get(3), andorA10.getInputPins().get(7), new Point(140, 665), new Point(140, 660));
+               new GUIWire(submodelModifiable, cell11.getOutputPins().get(0), andorA11.getInputPins().get(4), new Point(140, 785), new Point(140, 780));
+               new GUIWire(submodelModifiable, cell11.getOutputPins().get(1), andorA11.getInputPins().get(5), new Point(140, 795), new Point(140, 790));
+               new GUIWire(submodelModifiable, cell11.getOutputPins().get(2), andorA11.getInputPins().get(6), new Point(140, 805), new Point(140, 800));
+               new GUIWire(submodelModifiable, cell11.getOutputPins().get(3), andorA11.getInputPins().get(7), new Point(140, 815), new Point(140, 810));
+               new GUIWire(submodelModifiable, andB00  .getOutputPins().get(0), andorB01.getInputPins().get(0), new Point(305, 380), new Point(305, 445), new Point(245, 445), new Point(245, 490));
+               new GUIWire(submodelModifiable, andB00  .getOutputPins().get(1), andorB01.getInputPins().get(1), new Point(300, 390), new Point(300, 440), new Point(240, 440), new Point(240, 500));
+               new GUIWire(submodelModifiable, andB00  .getOutputPins().get(2), andorB01.getInputPins().get(2), new Point(295, 400), new Point(295, 435), new Point(235, 435), new Point(235, 510));
+               new GUIWire(submodelModifiable, andB00  .getOutputPins().get(3), andorB01.getInputPins().get(3), new Point(290, 410), new Point(290, 430), new Point(230, 430), new Point(230, 520));
+               new GUIWire(submodelModifiable, andorB01.getOutputPins().get(0), andorB10.getInputPins().get(0), new Point(305, 490), new Point(305, 595), new Point(245, 595), new Point(245, 640));
+               new GUIWire(submodelModifiable, andorB01.getOutputPins().get(1), andorB10.getInputPins().get(1), new Point(300, 500), new Point(300, 590), new Point(240, 590), new Point(240, 650));
+               new GUIWire(submodelModifiable, andorB01.getOutputPins().get(2), andorB10.getInputPins().get(2), new Point(295, 510), new Point(295, 585), new Point(235, 585), new Point(235, 660));
+               new GUIWire(submodelModifiable, andorB01.getOutputPins().get(3), andorB10.getInputPins().get(3), new Point(290, 520), new Point(290, 580), new Point(230, 580), new Point(230, 670));
+               new GUIWire(submodelModifiable, andorB10.getOutputPins().get(0), andorB11.getInputPins().get(0), new Point(305, 640), new Point(305, 745), new Point(245, 745), new Point(245, 790));
+               new GUIWire(submodelModifiable, andorB10.getOutputPins().get(1), andorB11.getInputPins().get(1), new Point(300, 650), new Point(300, 740), new Point(240, 740), new Point(240, 800));
+               new GUIWire(submodelModifiable, andorB10.getOutputPins().get(2), andorB11.getInputPins().get(2), new Point(295, 660), new Point(295, 735), new Point(235, 735), new Point(235, 810));
+               new GUIWire(submodelModifiable, andorB10.getOutputPins().get(3), andorB11.getInputPins().get(3), new Point(290, 670), new Point(290, 730), new Point(230, 730), new Point(230, 820));
+               new GUIWire(submodelModifiable, andorB11.getOutputPins().get(0), QB1                           , new Point(330, 790), new Point(330, 450));
+               new GUIWire(submodelModifiable, andorB11.getOutputPins().get(1), QB2                           , new Point(335, 800), new Point(335, 550));
+               new GUIWire(submodelModifiable, andorB11.getOutputPins().get(2), QB3                           , new Point(340, 810), new Point(340, 650));
+               new GUIWire(submodelModifiable, andorB11.getOutputPins().get(3), QB4                           , new Point(345, 820), new Point(345, 750));
+               new GUIWire(submodelModifiable, andA00  .getOutputPins().get(0), andorA01.getInputPins().get(0), new Point(210, 330), new Point(210, 430), new Point(150, 430), new Point(150, 440));
+               new GUIWire(submodelModifiable, andA00  .getOutputPins().get(1), andorA01.getInputPins().get(1), new Point(205, 340), new Point(205, 425), new Point(145, 425), new Point(145, 450));
+               new GUIWire(submodelModifiable, andA00  .getOutputPins().get(2), andorA01.getInputPins().get(2), new Point(200, 350), new Point(200, 420), new Point(140, 420), new Point(140, 460));
+               new GUIWire(submodelModifiable, andA00  .getOutputPins().get(3), andorA01.getInputPins().get(3), new Point(195, 360), new Point(195, 415), new Point(135, 415), new Point(135, 470));
+               new GUIWire(submodelModifiable, andorA01.getOutputPins().get(0), andorA10.getInputPins().get(0), new Point(210, 440), new Point(210, 580), new Point(150, 580), new Point(150, 590));
+               new GUIWire(submodelModifiable, andorA01.getOutputPins().get(1), andorA10.getInputPins().get(1), new Point(205, 450), new Point(205, 575), new Point(145, 575), new Point(145, 600));
+               new GUIWire(submodelModifiable, andorA01.getOutputPins().get(2), andorA10.getInputPins().get(2), new Point(200, 460), new Point(200, 570), new Point(140, 570), new Point(140, 610));
+               new GUIWire(submodelModifiable, andorA01.getOutputPins().get(3), andorA10.getInputPins().get(3), new Point(195, 470), new Point(195, 565), new Point(135, 565), new Point(135, 620));
+               new GUIWire(submodelModifiable, andorA10.getOutputPins().get(0), andorA11.getInputPins().get(0), new Point(210, 590), new Point(210, 730), new Point(150, 730), new Point(150, 740));
+               new GUIWire(submodelModifiable, andorA10.getOutputPins().get(1), andorA11.getInputPins().get(1), new Point(205, 600), new Point(205, 725), new Point(145, 725), new Point(145, 750));
+               new GUIWire(submodelModifiable, andorA10.getOutputPins().get(2), andorA11.getInputPins().get(2), new Point(200, 610), new Point(200, 720), new Point(140, 720), new Point(140, 760));
+               new GUIWire(submodelModifiable, andorA10.getOutputPins().get(3), andorA11.getInputPins().get(3), new Point(195, 620), new Point(195, 715), new Point(135, 715), new Point(135, 770));
+               new GUIWire(submodelModifiable, andorA11.getOutputPins().get(0), QA1                           , new Point(210, 740), new Point(210, 880), new Point(310, 880), new Point(310,  50));
+               new GUIWire(submodelModifiable, andorA11.getOutputPins().get(1), QA2                           , new Point(205, 750), new Point(205, 885), new Point(315, 885), new Point(315, 150));
+               new GUIWire(submodelModifiable, andorA11.getOutputPins().get(2), QA3                           , new Point(200, 760), new Point(200, 890), new Point(320, 890), new Point(320, 250));
+               new GUIWire(submodelModifiable, andorA11.getOutputPins().get(3), QA4                           , new Point(195, 770), new Point(195, 895), new Point(325, 895), new Point(325, 350));
                //@formatter:on
        }
 }
\ No newline at end of file
diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901ALUFuncDecode.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901ALUFuncDecode.java
new file mode 100644 (file)
index 0000000..48e2939
--- /dev/null
@@ -0,0 +1,95 @@
+package net.mograsim.logic.ui.model.components.mi.nandbased.am2901;
+
+import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
+import net.mograsim.logic.ui.model.ViewModelModifiable;
+import net.mograsim.logic.ui.model.components.GUINandGate;
+import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
+import net.mograsim.logic.ui.model.components.mi.nandbased.GUIand;
+import net.mograsim.logic.ui.model.components.mi.nandbased.GUInand3;
+import net.mograsim.logic.ui.model.wires.GUIWire;
+import net.mograsim.logic.ui.model.wires.Pin;
+import net.mograsim.logic.ui.model.wires.WireCrossPoint;
+
+public class GUIAm2901ALUFuncDecode extends SimpleRectangularSubmodelComponent
+{
+       public GUIAm2901ALUFuncDecode(ViewModelModifiable model)
+       {
+               super(model, 1, "GUIAm2901ALUFuncDecode");
+               setSubmodelScale(.25);
+               setInputCount(3);
+               setOutputCount(3);
+               initSubmodelComponents();
+       }
+
+       @SuppressWarnings("unused") // for GUIWires being created
+       private void initSubmodelComponents()
+       {
+               Pin I5 = getInputSubmodelPins().get(0);
+               Pin I4 = getInputSubmodelPins().get(1);
+               Pin I3 = getInputSubmodelPins().get(2);
+               Pin CinE = getOutputSubmodelPins().get(0);
+               Pin L = getOutputSubmodelPins().get(1);
+               Pin SBE = getOutputSubmodelPins().get(2);
+
+               GUINandGate notI5 = new GUINandGate(submodelModifiable, 1);
+               GUINandGate notI4 = new GUINandGate(submodelModifiable, 1);
+               GUInand3 nandI4I3NotI5 = new GUInand3(submodelModifiable);
+               GUINandGate nandI5NotI4 = new GUINandGate(submodelModifiable, 1);
+               GUINandGate nandI3I4 = new GUINandGate(submodelModifiable, 1);
+               GUINandGate nandL = new GUINandGate(submodelModifiable, 1);
+               GUIand andSBE = new GUIand(submodelModifiable);
+
+               WireCrossPoint cpI51 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpI52 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpI41 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpI42 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpI43 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpI3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpNotI51 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpNotI52 = new WireCrossPoint(submodelModifiable, 1);
+
+               notI5.moveTo(15, 10);
+               notI4.moveTo(15, 50);
+               nandI4I3NotI5.moveTo(55, 10);
+               nandI5NotI4.moveTo(55, 45);
+               nandI3I4.moveTo(55, 70);
+               nandL.moveTo(100, 50);
+               andSBE.moveTo(100, 95);
+               cpI51.moveCenterTo(5, 20);
+               cpI52.moveCenterTo(5, 25);
+               cpI41.moveCenterTo(10, 60);
+               cpI42.moveCenterTo(10, 55);
+               cpI43.moveCenterTo(10, 65);
+               cpI3.moveCenterTo(50, 75);
+               cpNotI51.moveCenterTo(40, 20);
+               cpNotI52.moveCenterTo(40, 35);
+
+               new GUIWire(submodelModifiable, I5, cpI51, new Point[0]);
+               new GUIWire(submodelModifiable, cpI51, notI5.getInputPins().get(0), new Point(5, 15));
+               new GUIWire(submodelModifiable, cpI51, cpI52, new Point[0]);
+               new GUIWire(submodelModifiable, cpI52, notI5.getInputPins().get(1), new Point[0]);
+               new GUIWire(submodelModifiable, cpI52, nandI5NotI4.getInputPins().get(0), new Point(5, 45), new Point(45, 45), new Point(45, 50));
+               new GUIWire(submodelModifiable, I4, cpI41, new Point[0]);
+               new GUIWire(submodelModifiable, cpI41, cpI42, new Point[0]);
+               new GUIWire(submodelModifiable, cpI42, nandI4I3NotI5.getInputPins().get(0), new Point(10, 40), new Point(45, 40),
+                               new Point(45, 15));
+               new GUIWire(submodelModifiable, cpI42, notI4.getInputPins().get(0), new Point[0]);
+               new GUIWire(submodelModifiable, cpI41, cpI43, new Point[0]);
+               new GUIWire(submodelModifiable, cpI43, notI4.getInputPins().get(1), new Point[0]);
+               new GUIWire(submodelModifiable, cpI43, nandI3I4.getInputPins().get(1), new Point(10, 85));
+               new GUIWire(submodelModifiable, I3, cpI3, new Point(50, 100));
+               new GUIWire(submodelModifiable, cpI3, nandI4I3NotI5.getInputPins().get(1), new Point(50, 25));
+               new GUIWire(submodelModifiable, cpI3, nandI3I4.getInputPins().get(0), new Point[0]);
+               new GUIWire(submodelModifiable, notI5.getOutputPin(), cpNotI51, new Point[0]);
+               new GUIWire(submodelModifiable, cpNotI51, CinE, new Point(40, 5), new Point(115, 5), new Point(115, 20));
+               new GUIWire(submodelModifiable, cpNotI51, cpNotI52, new Point[0]);
+               new GUIWire(submodelModifiable, cpNotI52, nandI4I3NotI5.getInputPins().get(2), new Point[0]);
+               new GUIWire(submodelModifiable, cpNotI52, andSBE.getInputPins().get(1), new Point(40, 110));
+               new GUIWire(submodelModifiable, notI4.getOutputPin(), nandI5NotI4.getInputPins().get(1), new Point[0]);
+               new GUIWire(submodelModifiable, nandI4I3NotI5.getOutputPins().get(0), nandL.getInputPins().get(0));
+               new GUIWire(submodelModifiable, nandI5NotI4.getOutputPin(), nandL.getInputPins().get(1));
+               new GUIWire(submodelModifiable, nandI3I4.getOutputPin(), andSBE.getInputPins().get(0));
+               new GUIWire(submodelModifiable, nandL.getOutputPin(), L, new Point[0]);
+               new GUIWire(submodelModifiable, andSBE.getOutputPins().get(0), SBE, new Point[0]);
+       }
+}
\ No newline at end of file
diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901ALUInclDecode.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/am2901/GUIAm2901ALUInclDecode.java
new file mode 100644 (file)
index 0000000..cb11ea4
--- /dev/null
@@ -0,0 +1,180 @@
+package net.mograsim.logic.ui.model.components.mi.nandbased.am2901;
+
+import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
+import net.mograsim.logic.ui.model.ViewModelModifiable;
+import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
+import net.mograsim.logic.ui.model.components.mi.nandbased.GUIxor;
+import net.mograsim.logic.ui.model.wires.GUIWire;
+import net.mograsim.logic.ui.model.wires.Pin;
+import net.mograsim.logic.ui.model.wires.WireCrossPoint;
+
+public class GUIAm2901ALUInclDecode extends SimpleRectangularSubmodelComponent
+{
+       public GUIAm2901ALUInclDecode(ViewModelModifiable model)
+       {
+               super(model, 1, "GUIAm2901ALUInclDecode");
+               setSubmodelScale(.25);
+               setInputCount(12);
+               setOutputCount(6);
+               initSubmodelComponents();
+       }
+
+       @SuppressWarnings("unused") // for GUIWires being created
+       private void initSubmodelComponents()
+       {
+               Pin I5 = getInputSubmodelPins().get(0);
+               Pin I4 = getInputSubmodelPins().get(1);
+               Pin I3 = getInputSubmodelPins().get(2);
+               Pin Cn = getInputSubmodelPins().get(3);
+               Pin R1 = getInputSubmodelPins().get(4);
+               Pin R2 = getInputSubmodelPins().get(5);
+               Pin R3 = getInputSubmodelPins().get(6);
+               Pin R4 = getInputSubmodelPins().get(7);
+               Pin S1 = getInputSubmodelPins().get(8);
+               Pin S2 = getInputSubmodelPins().get(9);
+               Pin S3 = getInputSubmodelPins().get(10);
+               Pin S4 = getInputSubmodelPins().get(11);
+               Pin F1 = getOutputSubmodelPins().get(0);
+               Pin F2 = getOutputSubmodelPins().get(1);
+               Pin F3 = getOutputSubmodelPins().get(2);
+               Pin F4 = getOutputSubmodelPins().get(3);
+               Pin Cnplus4 = getOutputSubmodelPins().get(4);
+               Pin OVR = getOutputSubmodelPins().get(5);
+
+               GUIAm2901ALUFuncDecode funcDecode = new GUIAm2901ALUFuncDecode(submodelModifiable);
+               GUIAm2901ALUOneBit alu1 = new GUIAm2901ALUOneBit(submodelModifiable);
+               GUIAm2901ALUOneBit alu2 = new GUIAm2901ALUOneBit(submodelModifiable);
+               GUIAm2901ALUOneBit alu3 = new GUIAm2901ALUOneBit(submodelModifiable);
+               GUIAm2901ALUOneBit alu4 = new GUIAm2901ALUOneBit(submodelModifiable);
+               GUIxor xorOVR = new GUIxor(submodelModifiable);
+
+               WireCrossPoint cpI5 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpI4 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpI3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpCoutE1 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpCoutE2 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpCoutE3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpCinE1 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpCinE2 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpCinE3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpRN1 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpRN2 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpRN3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpSN1 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpSN2 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpSN3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpFN1 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpFN2 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpFN3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpL1 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpL2 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpL3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpCnplus3 = new WireCrossPoint(submodelModifiable, 1);
+               WireCrossPoint cpCnplus4 = new WireCrossPoint(submodelModifiable, 1);
+
+               funcDecode.moveTo(15, 25);
+               alu1.moveTo(45, 80);
+               alu2.moveTo(45, 180);
+               alu3.moveTo(45, 280);
+               alu4.moveTo(45, 380);
+               xorOVR.moveTo(95, 400);
+               cpI5.moveCenterTo(5, 20);
+               cpI4.moveCenterTo(5, 60);
+               cpI3.moveCenterTo(10, 65);
+               cpCoutE1.moveCenterTo(25, 95);
+               cpCoutE2.moveCenterTo(25, 195);
+               cpCoutE3.moveCenterTo(25, 295);
+               cpCinE1.moveCenterTo(27.5, 105);
+               cpCinE2.moveCenterTo(27.5, 205);
+               cpCinE3.moveCenterTo(27.5, 305);
+               cpRN1.moveCenterTo(30, 125);
+               cpRN2.moveCenterTo(30, 225);
+               cpRN3.moveCenterTo(30, 325);
+               cpSN1.moveCenterTo(32.5, 145);
+               cpSN2.moveCenterTo(32.5, 245);
+               cpSN3.moveCenterTo(32.5, 345);
+               cpFN1.moveCenterTo(35, 155);
+               cpFN2.moveCenterTo(35, 255);
+               cpFN3.moveCenterTo(35, 355);
+               cpL1.moveCenterTo(37.5, 165);
+               cpL2.moveCenterTo(37.5, 265);
+               cpL3.moveCenterTo(37.5, 365);
+               cpCnplus3.moveCenterTo(85, 375);
+               cpCnplus4.moveCenterTo(85, 385);
+
+               new GUIWire(submodelModifiable, I5, cpI5, new Point[0]);
+               new GUIWire(submodelModifiable, cpI5, funcDecode.getInputPins().get(0), new Point(5, 30));
+               new GUIWire(submodelModifiable, I4, cpI4, new Point[0]);
+               new GUIWire(submodelModifiable, cpI4, funcDecode.getInputPins().get(1), new Point(5, 40));
+               new GUIWire(submodelModifiable, I3, cpI3, new Point(10, 100));
+               new GUIWire(submodelModifiable, cpI3, funcDecode.getInputPins().get(2), new Point(10, 50));
+               new GUIWire(submodelModifiable, funcDecode.getOutputPins().get(2), cpCoutE1, new Point(52.5, 50), new Point(52.5, 57.5),
+                               new Point(25, 57.5));
+               new GUIWire(submodelModifiable, cpCoutE1, cpCoutE2, new Point[0]);
+               new GUIWire(submodelModifiable, cpCoutE2, cpCoutE3, new Point[0]);
+               new GUIWire(submodelModifiable, cpCoutE1, alu1.getInputPins().get(1), new Point[0]);
+               new GUIWire(submodelModifiable, cpCoutE2, alu2.getInputPins().get(1), new Point[0]);
+               new GUIWire(submodelModifiable, cpCoutE3, alu3.getInputPins().get(1), new Point[0]);
+               new GUIWire(submodelModifiable, cpCoutE3, alu4.getInputPins().get(1), new Point(25, 395));
+               new GUIWire(submodelModifiable, funcDecode.getOutputPins().get(0), cpCinE1, new Point(57.5, 30), new Point(57.5, 62.5),
+                               new Point(27.5, 62.5));
+               new GUIWire(submodelModifiable, cpCinE1, cpCinE2, new Point[0]);
+               new GUIWire(submodelModifiable, cpCinE2, cpCinE3, new Point[0]);
+               new GUIWire(submodelModifiable, cpCinE1, alu1.getInputPins().get(2), new Point[0]);
+               new GUIWire(submodelModifiable, cpCinE2, alu2.getInputPins().get(2), new Point[0]);
+               new GUIWire(submodelModifiable, cpCinE3, alu3.getInputPins().get(2), new Point[0]);
+               new GUIWire(submodelModifiable, cpCinE3, alu4.getInputPins().get(2), new Point(27.5, 405));
+               new GUIWire(submodelModifiable, cpI3, cpRN1, new Point(30, 65));
+               new GUIWire(submodelModifiable, cpRN1, cpRN2, new Point[0]);
+               new GUIWire(submodelModifiable, cpRN2, cpRN3, new Point[0]);
+               new GUIWire(submodelModifiable, cpRN1, alu1.getInputPins().get(4), new Point[0]);
+               new GUIWire(submodelModifiable, cpRN2, alu2.getInputPins().get(4), new Point[0]);
+               new GUIWire(submodelModifiable, cpRN3, alu3.getInputPins().get(4), new Point[0]);
+               new GUIWire(submodelModifiable, cpRN3, alu4.getInputPins().get(4), new Point(30, 425));
+               new GUIWire(submodelModifiable, cpI4, cpSN1, new Point(32.5, 60));
+               new GUIWire(submodelModifiable, cpSN1, cpSN2, new Point[0]);
+               new GUIWire(submodelModifiable, cpSN2, cpSN3, new Point[0]);
+               new GUIWire(submodelModifiable, cpSN1, alu1.getInputPins().get(6), new Point[0]);
+               new GUIWire(submodelModifiable, cpSN2, alu2.getInputPins().get(6), new Point[0]);
+               new GUIWire(submodelModifiable, cpSN3, alu3.getInputPins().get(6), new Point[0]);
+               new GUIWire(submodelModifiable, cpSN3, alu4.getInputPins().get(6), new Point(32.5, 445));
+               new GUIWire(submodelModifiable, cpI5, cpFN1, new Point(60, 20), new Point(60, 65), new Point(35, 65));
+               new GUIWire(submodelModifiable, cpFN1, cpFN2, new Point[0]);
+               new GUIWire(submodelModifiable, cpFN2, cpFN3, new Point[0]);
+               new GUIWire(submodelModifiable, cpFN1, alu1.getInputPins().get(7), new Point[0]);
+               new GUIWire(submodelModifiable, cpFN2, alu2.getInputPins().get(7), new Point[0]);
+               new GUIWire(submodelModifiable, cpFN3, alu3.getInputPins().get(7), new Point[0]);
+               new GUIWire(submodelModifiable, cpFN3, alu4.getInputPins().get(7), new Point(35, 455));
+               new GUIWire(submodelModifiable, funcDecode.getOutputPins().get(1), cpL1, new Point(55, 40), new Point(55, 60), new Point(37.5, 60));
+               new GUIWire(submodelModifiable, cpL1, cpL2, new Point[0]);
+               new GUIWire(submodelModifiable, cpL2, cpL3, new Point[0]);
+               new GUIWire(submodelModifiable, cpL1, alu1.getInputPins().get(8), new Point[0]);
+               new GUIWire(submodelModifiable, cpL2, alu2.getInputPins().get(8), new Point[0]);
+               new GUIWire(submodelModifiable, cpL3, alu3.getInputPins().get(8), new Point[0]);
+               new GUIWire(submodelModifiable, cpL3, alu4.getInputPins().get(8), new Point(37.5, 465));
+               new GUIWire(submodelModifiable, R1, alu1.getInputPins().get(3), new Point(10, 180), new Point(10, 115));
+               new GUIWire(submodelModifiable, R2, alu2.getInputPins().get(3), new Point(10, 220), new Point(10, 215));
+               new GUIWire(submodelModifiable, R3, alu3.getInputPins().get(3), new Point(10, 260), new Point(10, 315));
+               new GUIWire(submodelModifiable, R4, alu4.getInputPins().get(3), new Point(20, 300), new Point(20, 415));
+               new GUIWire(submodelModifiable, S1, alu1.getInputPins().get(5), new Point(15, 340), new Point(15, 135));
+               new GUIWire(submodelModifiable, S2, alu2.getInputPins().get(5), new Point(5, 380), new Point(5, 235));
+               new GUIWire(submodelModifiable, S3, alu3.getInputPins().get(5), new Point(10, 420), new Point(10, 335));
+               new GUIWire(submodelModifiable, S4, alu4.getInputPins().get(5), new Point(10, 460), new Point(10, 435));
+               new GUIWire(submodelModifiable, Cn, alu1.getInputPins().get(0), new Point(5, 140), new Point(5, 85));
+               new GUIWire(submodelModifiable, alu1.getOutputPins().get(0), alu2.getInputPins().get(0), new Point(85, 85), new Point(85, 175),
+                               new Point(40, 175), new Point(40, 185));
+               new GUIWire(submodelModifiable, alu2.getOutputPins().get(0), alu3.getInputPins().get(0), new Point(85, 185), new Point(85, 275),
+                               new Point(40, 275), new Point(40, 285));
+               new GUIWire(submodelModifiable, alu3.getOutputPins().get(0), cpCnplus3, new Point(85, 285));
+               new GUIWire(submodelModifiable, cpCnplus3, alu4.getInputPins().get(0), new Point(40, 375), new Point(40, 385));
+               new GUIWire(submodelModifiable, alu4.getOutputPins().get(0), cpCnplus4, new Point[0]);
+               new GUIWire(submodelModifiable, alu1.getOutputPins().get(1), F1, new Point(90, 95), new Point(90, 20));
+               new GUIWire(submodelModifiable, alu2.getOutputPins().get(1), F2, new Point(95, 195), new Point(95, 60));
+               new GUIWire(submodelModifiable, alu3.getOutputPins().get(1), F3, new Point(100, 295), new Point(100, 100));
+               new GUIWire(submodelModifiable, alu4.getOutputPins().get(1), F4, new Point(105, 395), new Point(105, 140));
+               new GUIWire(submodelModifiable, cpCnplus3, xorOVR.getInputPins().get(0), new Point(90, 375), new Point(90, 405));
+               new GUIWire(submodelModifiable, cpCnplus4, xorOVR.getInputPins().get(1), new Point(85, 415));
+               new GUIWire(submodelModifiable, cpCnplus4, Cnplus4, new Point(130, 385), new Point(130, 180));
+               new GUIWire(submodelModifiable, xorOVR.getOutputPins().get(0), OVR);
+       }
+}
\ No newline at end of file
index 669bb1b..098d774 100644 (file)
@@ -4,9 +4,9 @@ import net.mograsim.logic.ui.model.components.GUIComponent;
 
 public class MovablePin extends Pin
 {
-       public MovablePin(GUIComponent component, int logicWidth, double relX, double relY)
+       public MovablePin(GUIComponent component, String name, int logicWidth, double relX, double relY)
        {
-               super(component, logicWidth, relX, relY);
+               super(component, name, logicWidth, relX, relY);
        }
 
        @Override
index f8325a0..9be0800 100644 (file)
@@ -8,10 +8,10 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.ui.model.components.GUIComponent;
 
-//TODO add an ID and/or a name
 public class Pin
 {
        public final GUIComponent component;
+       public final String name;
        public final int logicWidth;
 
        protected double relX;
@@ -20,9 +20,10 @@ public class Pin
        private final List<Consumer<? super Pin>> pinMovedListeners;
        private final List<Runnable> redrawListeners;
 
-       public Pin(GUIComponent component, int logicWidth, double relX, double relY)
+       public Pin(GUIComponent component, String name, int logicWidth, double relX, double relY)
        {
                this.component = component;
+               this.name = name;
                this.logicWidth = logicWidth;
                this.relX = relX;
                this.relY = relY;
index 32f04ae..d5e633d 100644 (file)
@@ -28,7 +28,7 @@ public class WireCrossPoint extends GUIComponent
 \r
                this.logicWidth = logicWidth;\r
                setSize(CIRCLE_DIAM, CIRCLE_DIAM);\r
-               addPin(this.pin = new Pin(this, logicWidth, CIRCLE_RADIUS, CIRCLE_RADIUS));\r
+               addPin(this.pin = new Pin(this, "", logicWidth, CIRCLE_RADIUS, CIRCLE_RADIUS));\r
        }\r
 \r
        public void moveCenterTo(double x, double y)\r