1 package net.mograsim.logic.ui.model.components.mi.nandbased.am2901;
3 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
4 import net.mograsim.logic.ui.model.ViewModelModifiable;
5 import net.mograsim.logic.ui.model.components.GUINandGate;
6 import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
7 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIand;
8 import net.mograsim.logic.ui.model.components.mi.nandbased.GUInand3;
9 import net.mograsim.logic.ui.model.wires.GUIWire;
10 import net.mograsim.logic.ui.model.wires.Pin;
11 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
13 public class GUIAm2901ALUFuncDecode extends SimpleRectangularSubmodelComponent
15 public GUIAm2901ALUFuncDecode(ViewModelModifiable model)
17 super(model, 1, "GUIAm2901ALUFuncDecode");
18 setSubmodelScale(.25);
19 setInputPins("I5", "I4", "I3");
20 setOutputPins("CinE", "L", "SBE");
21 initSubmodelComponents();
24 @SuppressWarnings("unused") // for GUIWires being created
25 private void initSubmodelComponents()
27 Pin I5 = getSubmodelPin("I5");
28 Pin I4 = getSubmodelPin("I4");
29 Pin I3 = getSubmodelPin("I3");
30 Pin CinE = getSubmodelPin("CinE");
31 Pin L = getSubmodelPin("L");
32 Pin SBE = getSubmodelPin("SBE");
34 GUINandGate notI5 = new GUINandGate(submodelModifiable, 1);
35 GUINandGate notI4 = new GUINandGate(submodelModifiable, 1);
36 GUInand3 nandI4I3NotI5 = new GUInand3(submodelModifiable);
37 GUINandGate nandI5NotI4 = new GUINandGate(submodelModifiable, 1);
38 GUINandGate nandI3I4 = new GUINandGate(submodelModifiable, 1);
39 GUINandGate nandL = new GUINandGate(submodelModifiable, 1);
40 GUIand andSBE = new GUIand(submodelModifiable);
42 WireCrossPoint cpI51 = new WireCrossPoint(submodelModifiable, 1);
43 WireCrossPoint cpI52 = new WireCrossPoint(submodelModifiable, 1);
44 WireCrossPoint cpI41 = new WireCrossPoint(submodelModifiable, 1);
45 WireCrossPoint cpI42 = new WireCrossPoint(submodelModifiable, 1);
46 WireCrossPoint cpI43 = new WireCrossPoint(submodelModifiable, 1);
47 WireCrossPoint cpI3 = new WireCrossPoint(submodelModifiable, 1);
48 WireCrossPoint cpNotI51 = new WireCrossPoint(submodelModifiable, 1);
49 WireCrossPoint cpNotI52 = new WireCrossPoint(submodelModifiable, 1);
53 nandI4I3NotI5.moveTo(55, 10);
54 nandI5NotI4.moveTo(55, 45);
55 nandI3I4.moveTo(55, 70);
56 nandL.moveTo(100, 50);
57 andSBE.moveTo(100, 95);
58 cpI51.moveCenterTo(5, 20);
59 cpI52.moveCenterTo(5, 25);
60 cpI41.moveCenterTo(10, 60);
61 cpI42.moveCenterTo(10, 55);
62 cpI43.moveCenterTo(10, 65);
63 cpI3.moveCenterTo(50, 75);
64 cpNotI51.moveCenterTo(40, 20);
65 cpNotI52.moveCenterTo(40, 35);
67 new GUIWire(submodelModifiable, I5, cpI51, new Point[0]);
68 new GUIWire(submodelModifiable, cpI51, notI5.getPin("A"), new Point(5, 15));
69 new GUIWire(submodelModifiable, cpI51, cpI52, new Point[0]);
70 new GUIWire(submodelModifiable, cpI52, notI5.getPin("B"), new Point[0]);
71 new GUIWire(submodelModifiable, cpI52, nandI5NotI4.getPin("A"), new Point(5, 45), new Point(45, 45), new Point(45, 50));
72 new GUIWire(submodelModifiable, I4, cpI41, new Point[0]);
73 new GUIWire(submodelModifiable, cpI41, cpI42, new Point[0]);
74 new GUIWire(submodelModifiable, cpI42, nandI4I3NotI5.getPin("A"), new Point(10, 40), new Point(45, 40), new Point(45, 15));
75 new GUIWire(submodelModifiable, cpI42, notI4.getPin("A"), new Point[0]);
76 new GUIWire(submodelModifiable, cpI41, cpI43, new Point[0]);
77 new GUIWire(submodelModifiable, cpI43, notI4.getPin("B"), new Point[0]);
78 new GUIWire(submodelModifiable, cpI43, nandI3I4.getPin("B"), new Point(10, 85));
79 new GUIWire(submodelModifiable, I3, cpI3, new Point(50, 100));
80 new GUIWire(submodelModifiable, cpI3, nandI4I3NotI5.getPin("B"), new Point(50, 25));
81 new GUIWire(submodelModifiable, cpI3, nandI3I4.getPin("A"), new Point[0]);
82 new GUIWire(submodelModifiable, notI5.getPin("Y"), cpNotI51, new Point[0]);
83 new GUIWire(submodelModifiable, cpNotI51, CinE, new Point(40, 5), new Point(115, 5), new Point(115, 20));
84 new GUIWire(submodelModifiable, cpNotI51, cpNotI52, new Point[0]);
85 new GUIWire(submodelModifiable, cpNotI52, nandI4I3NotI5.getPin("C"), new Point[0]);
86 new GUIWire(submodelModifiable, cpNotI52, andSBE.getPin("B"), new Point(40, 110));
87 new GUIWire(submodelModifiable, notI4.getPin("Y"), nandI5NotI4.getPin("B"), new Point[0]);
88 new GUIWire(submodelModifiable, nandI4I3NotI5.getPin("Y"), nandL.getPin("A"));
89 new GUIWire(submodelModifiable, nandI5NotI4.getPin("Y"), nandL.getPin("B"));
90 new GUIWire(submodelModifiable, nandI3I4.getPin("Y"), andSBE.getPin("A"));
91 new GUIWire(submodelModifiable, nandL.getPin("Y"), L, new Point[0]);
92 new GUIWire(submodelModifiable, andSBE.getPin("Y"), SBE, new Point[0]);