diff --git a/.idea/misc.xml b/.idea/misc.xml
index bf392ff..05cb644 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -3,7 +3,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_34_AM_[Default_Changelist]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_34_AM_[Default_Changelist]/shelved.patch
new file mode 100644
index 0000000..1383f40
--- /dev/null
+++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_34_AM_[Default_Changelist]/shelved.patch
@@ -0,0 +1,200 @@
+Index: src/simulator/Processor.java
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
+<+>//Dedicated to Goli\r\n\r\npackage simulator;\r\n\r\nimport simulator.control.Simulator;\r\nimport simulator.gates.combinational.ByteMemory;\r\nimport simulator.gates.combinational.Memory;\r\nimport simulator.gates.sequential.Clock;\r\nimport simulator.network.Link;\r\nimport simulator.wrapper.wrappers.*;\r\n\r\npublic class Processor {\r\n public static void main(String[] args) {\r\n // Creating needed wrapper :\r\n\r\n Clock clock = new Clock(\"Clock\",1000);\r\n\r\n PCUpdate pcUpdate = new PCUpdate(\"PCUpdate\",\"78x32\");\r\n\r\n ByteMemory instructionMemory = new ByteMemory(\"InstructionMemory\");\r\n\r\n Multiplexer2x1 []registerFileInput = new Multiplexer2x1[5];\r\n for (int i = 0 ; i < 5 ; i++)\r\n registerFileInput[i] = new Multiplexer2x1(\"RegisterFileInput_\"+i,\"3x1\");\r\n\r\n ControlUnit controlUnit = new ControlUnit(\"ControlUnit\",\"6X10\");\r\n\r\n RegisterFile registerFile = new RegisterFile(\"RegisterFile\",\"49x64\");\r\n\r\n ALUControl aluControl = new ALUControl(\"ALUControl\",\"8X4\");\r\n\r\n SignExtend immediate = new SignExtend(\"Immediate\",\"16X32\");\r\n\r\n Multiplexer2x1 []aluInput = new Multiplexer2x1[32];\r\n for (int i = 0 ; i < 32 ; i++)\r\n aluInput[i] = new Multiplexer2x1(\"ALUInput_\"+i,\"3x1\");\r\n\r\n ALU alu = new ALU(\"ALU\",\"68X33\");\r\n\r\n ByteMemory dataMemory = new ByteMemory(\"DataMemory\");\r\n\r\n Multiplexer2x1 []writeRegisterData = new Multiplexer2x1[32];\r\n for (int i = 0 ; i < 32 ; i++)\r\n writeRegisterData[i] = new Multiplexer2x1(\"WriteRegisterData_\"+i,\"3X1\");\r\n\r\n\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Pushing instructions to instruction memory\r\n Link []startAddress = new Link[32];\r\n for( int i = 0 ; i < 32 ; i++)\r\n startAddress[i] = Simulator.falseLogic;\r\n\r\n Boolean [][]instrucions = new Boolean[32][32];\r\n // add instructions here\r\n\r\n\r\n\r\n instructionMemory.setMemory(instrucions);\r\n // end of creation\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting gates and wrappers together\r\n\r\n\r\n // Connecting PCUpdate\r\n pcUpdate.addInput(clock.getOutput(0));// add clock for pc\r\n pcUpdate.addInput(startAddress);// add start address for fetch instruction\r\n for (int i = 16 ; i < 32 ; i++) {// add branch offset\r\n pcUpdate.addInput(instructionMemory.getOutput(i));\r\n }\r\n for (int i = 6; i < 32 ; i++)// add jump address\r\n pcUpdate.addInput(instructionMemory.getOutput(i));\r\n\r\n pcUpdate.addInput(alu.getInput(0));// add zero flag\r\n pcUpdate.addInput(controlUnit.getOutput(6));// add branch flag\r\n pcUpdate.addInput(controlUnit.getOutput(7));// add jump flag\r\n\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting instruction memory\r\n instructionMemory.addInput(Simulator.falseLogic);\r\n for(int i = 16 ; i < 32 ; i++)// add address to fetch instruction\r\n instructionMemory.addInput(pcUpdate.getOutput(i));\r\n\r\n for(int i = 16 ; i < 32 ; i++)// add don't care data\r\n instructionMemory.addInput(Simulator.falseLogic);\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting register file input\r\n for (int i = 0 ; i < 5 ; i++) { // register file mux inputs\r\n registerFileInput[i].addInput(controlUnit.getOutput(0));// selector(RegDest)\r\n registerFileInput[i].addInput(instructionMemory.getOutput(11+i),instructionMemory.getOutput(16+i));// rs,rt\r\n }\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting register file\r\n registerFile.addInput(clock.getOutput(0));// add clock\r\n registerFile.addInput(controlUnit.getOutput(3));// add write signal(RegWrite)\r\n for (int i = 0 ; i < 5 ; i++) { // register file write register\r\n registerFile.addInput(registerFileInput[i].getOutput(0));\r\n }\r\n for (int i = 0 ; i < 5 ; i++) { // register file first read register\r\n registerFile.addInput(instructionMemory.getOutput(11+i));\r\n }\r\n for (int i = 0 ; i < 5 ; i++) { // register file second read register\r\n registerFile.addInput(instructionMemory.getOutput(6+i));\r\n }\r\n for (int i = 0 ; i < 32 ; i++){// write register data\r\n registerFile.addInput(writeRegisterData[i].getOutput(0));\r\n }\r\n\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting control unit\r\n for (int i = 0 ; i < 5 ; i++){// add opcode to control unit\r\n controlUnit.addInput(instructionMemory.getOutput(i));\r\n }\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting alu control\r\n aluControl.addInput(controlUnit.getOutput(8),clock.getOutput(9));// add aluOp\r\n for (int i = 0 ; i < 6 ; i++) // add funct\r\n aluControl.addInput(instructionMemory.getOutput(26+i));\r\n\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting signExtend for immediate input\r\n for (int i = 16 ; i < 32 ; i++) {// add branch offset\r\n immediate.addInput(instructionMemory.getOutput(i));\r\n }\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting alu second input mux\r\n for (int i = 0 ; i < 32 ; i++){// add alu input\r\n aluInput[i].addInput(controlUnit.getOutput(1));// selector(AluSrc)\r\n aluInput[i].addInput(registerFile.getOutput(32+i),immediate.getOutput(i));// from register or immediate\r\n }\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting alu\r\n for (int i = 0 ; i < 4 ; i++) // add aluControl to alu\r\n alu.addInput(aluControl.getOutput(i));\r\n\r\n for (int i = 0 ; i < 32 ; i++){// add first input from register file\r\n alu.addInput(registerFile.getInput(i));\r\n }\r\n\r\n for (int i = 0 ; i < 32 ; i++){// add second input form mux\r\n alu.addInput(aluInput[i].getOutput(0));\r\n }\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting data memory\r\n dataMemory.addInput(controlUnit.getOutput(5));// write flag\r\n for (int i = 16 ; i < 32 ; i++){// add address\r\n dataMemory.addInput(alu.getOutput(i));\r\n }\r\n for (int i = 0 ; i < 32 ; i++){// add write data\r\n dataMemory.addInput(registerFile.getOutput(32+i));\r\n }\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n // Connecting write back mux\r\n for (int i = 0 ; i < 32 ; i++) {\r\n writeRegisterData[i].addInput(controlUnit.getOutput(2));// selector(MemToReg)\r\n writeRegisterData[i].addInput(alu.getOutput(i), dataMemory.getOutput(i)); // inputs\r\n }\r\n\r\n //--------------------------------------------------------------------------------------------------------------\r\n\r\n\r\n\r\n Simulator.debugger.addTrackItem(clock,dataMemory,registerFile);\r\n Simulator.debugger.setDelay(2000);\r\n Simulator.circuit.startCircuit();\r\n }\r\n}
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- src/simulator/Processor.java (revision 679e8f8590ac81343d8c383e82523219b4608d18)
++++ src/simulator/Processor.java (date 1595653003441)
+@@ -1,5 +1,3 @@
+-//Dedicated to Goli
+-
+ package simulator;
+
+ import simulator.control.Simulator;
+@@ -11,7 +9,7 @@
+
+ public class Processor {
+ public static void main(String[] args) {
+- // Creating needed wrapper :
++ // Creating needed wrapper :
+
+ Clock clock = new Clock("Clock",1000);
+
+@@ -41,7 +39,7 @@
+
+ Multiplexer2x1 []writeRegisterData = new Multiplexer2x1[32];
+ for (int i = 0 ; i < 32 ; i++)
+- writeRegisterData[i] = new Multiplexer2x1("WriteRegisterData_"+i,"3X1");
++ writeRegisterData[i] = new Multiplexer2x1("WriteRegisterData_"+i,"3X1");
+
+
+
+@@ -51,10 +49,79 @@
+ for( int i = 0 ; i < 32 ; i++)
+ startAddress[i] = Simulator.falseLogic;
+
+- Boolean [][]instrucions = new Boolean[32][32];
++ Boolean [][]instrucions = new Boolean[65536][8];
+ // add instructions here
+
+
++ for(int i=0 ; i<65536 ; i++)
++ for(int j=0 ; j<8 ; j++)
++ instrucions[i][j] = true;
++
++
++ // sw $t0,0($t1)
++ // lw $t0,0($t1)
++ instrucions[4][0] = true; instrucions[4][1] = false;
++ instrucions[4][2] = true; instrucions[4][3] = false;
++ instrucions[4][4] = true; instrucions[4][5] = true;
++ instrucions[4][6] = false; instrucions[4][7] = true;
++
++ instrucions[5][0] = false; instrucions[5][1] = false;
++ instrucions[5][2] = true; instrucions[5][3] = false;
++ instrucions[5][4] = true; instrucions[5][5] = false;
++ instrucions[5][6] = false; instrucions[5][7] = false;
++
++ instrucions[6][0] = false; instrucions[6][1] = false;
++ instrucions[6][2] = false; instrucions[6][3] = false;
++ instrucions[6][4] = false; instrucions[6][5] = false;
++ instrucions[6][6] = false; instrucions[6][7] = false;
++
++ instrucions[7][0] = false; instrucions[7][1] = false;
++ instrucions[7][2] = false; instrucions[7][3] = false;
++ instrucions[7][4] = false; instrucions[7][5] = false;
++ instrucions[7][6] = false; instrucions[7][7] = false;
++
++ /////////////////////////////////////////////////////////
++
++
++ instrucions[8][0] = true; instrucions[8][1] = false;
++ instrucions[8][2] = false; instrucions[8][3] = false;
++ instrucions[8][4] = true; instrucions[8][5] = true;
++ instrucions[8][6] = false; instrucions[8][7] = true;
++
++ instrucions[9][0] = false; instrucions[9][1] = false;
++ instrucions[9][2] = true; instrucions[9][3] = false;
++ instrucions[9][4] = true; instrucions[9][5] = false;
++ instrucions[9][6] = false; instrucions[9][7] = false;
++
++ instrucions[10][0] = false; instrucions[10][1] = false;
++ instrucions[10][2] = false; instrucions[10][3] = false;
++ instrucions[10][4] = false; instrucions[10][5] = false;
++ instrucions[10][6] = false; instrucions[10][7] = false;
++
++ instrucions[11][0] = false; instrucions[11][1] = false;
++ instrucions[11][2] = false; instrucions[11][3] = false;
++ instrucions[11][4] = false; instrucions[11][5] = false;
++ instrucions[11][6] = false; instrucions[11][7] = false;
++
++
++
++
++// instrucions[0][0] = true; instrucions[0][1] = false;
++// instrucions[0][2] = false; instrucions[0][3] = false;
++// instrucions[0][4] = true; instrucions[0][5] = true;
++//
++// instrucions[0][6] = false; instrucions[0][7] = true;
++// instrucions[0][8] = false; instrucions[0][9] = false;
++// instrucions[0][10] = true;
++//
++// instrucions[0][11] = false; instrucions[0][12] = true;
++// instrucions[0][13] = false; instrucions[0][14] = false;
++// instrucions[0][15] = false;
++//
++// for(int i=16 ; i<32 ; i++)
++// instrucions[0][i] = false;
++
++
+
+ instructionMemory.setMemory(instrucions);
+ // end of creation
+@@ -71,7 +138,7 @@
+ for (int i = 6; i < 32 ; i++)// add jump address
+ pcUpdate.addInput(instructionMemory.getOutput(i));
+
+- pcUpdate.addInput(alu.getInput(0));// add zero flag
++ pcUpdate.addInput(alu.getOutput(0));// add zero flag
+ pcUpdate.addInput(controlUnit.getOutput(6));// add branch flag
+ pcUpdate.addInput(controlUnit.getOutput(7));// add jump flag
+
+@@ -79,11 +146,13 @@
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting instruction memory
+ instructionMemory.addInput(Simulator.falseLogic);
++
++// for(int i = 16 ; i < 32 ; i++)// add don't care data
++// instructionMemory.addInput(Simulator.falseLogic);
++
+ for(int i = 16 ; i < 32 ; i++)// add address to fetch instruction
+ instructionMemory.addInput(pcUpdate.getOutput(i));
+
+- for(int i = 16 ; i < 32 ; i++)// add don't care data
+- instructionMemory.addInput(Simulator.falseLogic);
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting register file input
+@@ -112,13 +181,13 @@
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting control unit
+- for (int i = 0 ; i < 5 ; i++){// add opcode to control unit
++ for (int i = 0 ; i < 6 ; i++){// add opcode to control unit
+ controlUnit.addInput(instructionMemory.getOutput(i));
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting alu control
+- aluControl.addInput(controlUnit.getOutput(8),clock.getOutput(9));// add aluOp
++ aluControl.addInput(controlUnit.getOutput(8),controlUnit.getOutput(9));// add aluOp
+ for (int i = 0 ; i < 6 ; i++) // add funct
+ aluControl.addInput(instructionMemory.getOutput(26+i));
+
+@@ -152,7 +221,7 @@
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting data memory
+ dataMemory.addInput(controlUnit.getOutput(5));// write flag
+- for (int i = 16 ; i < 32 ; i++){// add address
++ for (int i = 17 ; i < 33 ; i++){// add address
+ dataMemory.addInput(alu.getOutput(i));
+ }
+ for (int i = 0 ; i < 32 ; i++){// add write data
+@@ -163,14 +232,15 @@
+ // Connecting write back mux
+ for (int i = 0 ; i < 32 ; i++) {
+ writeRegisterData[i].addInput(controlUnit.getOutput(2));// selector(MemToReg)
+- writeRegisterData[i].addInput(alu.getOutput(i), dataMemory.getOutput(i)); // inputs
++ writeRegisterData[i].addInput(alu.getOutput(i+1), dataMemory.getOutput(i)); // inputs
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+
+
+
+- Simulator.debugger.addTrackItem(clock,dataMemory,registerFile);
++ Simulator.debugger.addTrackItem(clock,dataMemory,registerFile,alu,instructionMemory,
++ pcUpdate,controlUnit,aluControl,immediate);
+ Simulator.debugger.setDelay(2000);
+ Simulator.circuit.startCircuit();
+ }
+Index: src/simulator/wrapper/wrappers/ALU.java
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
+<+>package simulator.wrapper.wrappers;\r\n\r\nimport simulator.control.Simulator;\r\nimport simulator.gates.combinational.And;\r\nimport simulator.gates.combinational.Not;\r\nimport simulator.gates.combinational.Or;\r\nimport simulator.network.Link;\r\nimport simulator.wrapper.Wrapper;\r\n\r\npublic class ALU extends Wrapper {\r\n public ALU (String label, String stream, Link... links) {\r\n super(label, stream, links);\r\n }\r\n @Override\r\n //I considered the first four inputs as inputs Alu Contorl\r\n //The next 32 bits, ie from index 4 to 35, are the input of the first register\r\n //The next 32 bits, ie from index 36 to 67, are the input of the second register\r\n //Input and output is a link...\r\n // index 0 of output is Ziro\r\n\r\n public void initialize() {\r\n Not nota = new Not(\"nota\");\r\n Not notb = new Not(\"notb\");\r\n Not notc = new Not(\"notc\");\r\n Not notd = new Not(\"notd\");\r\n nota.addInput(getInput(0));\r\n notb.addInput(getInput(1));\r\n notc.addInput(getInput(2));\r\n notd.addInput(getInput(3));\r\n\r\n And CAdd= new And(\"C-add\");\r\n And CSub= new And(\"C-sub\");\r\n And CAnd= new And(\"C-and\");\r\n And COr= new And(\"C-or\");\r\n And CSlt= new And(\"C-slt\");\r\n\r\n CAdd.addInput(nota.getOutput(0),notb.getOutput(0),getInput(2),notd.getOutput(0));\r\n CSub.addInput(nota.getOutput(0),getInput(1),getInput(2),notd.getOutput(0));\r\n CAnd.addInput(nota.getOutput(0),notb.getOutput(0),notc.getOutput(0),notd.getOutput(0));\r\n COr.addInput(nota.getOutput(0),notb.getOutput(0),notc.getOutput(0),getInput(3));\r\n CSlt.addInput(nota.getOutput(0),getInput(1),getInput(2),getInput(3));\r\n\r\n Adder adder=new Adder(\"adder\",\"64X33\",\r\n getInput(4),getInput(5),getInput(6),getInput(7),getInput(8),getInput(9),getInput(10),\r\n getInput(11),getInput(12),getInput(13),getInput(14),getInput(15),getInput(16),getInput(17),\r\n getInput(18),getInput(19),getInput(20),getInput(21),getInput(22),getInput(23),getInput(24),\r\n getInput(25),getInput(26),getInput(27),getInput(28),getInput(29),getInput(30),getInput(31),\r\n getInput(32),getInput(33),getInput(34),getInput(35),getInput(36),getInput(37),getInput(38),\r\n getInput(39),getInput(40),getInput(41),getInput(42),getInput(43),getInput(44),getInput(45),\r\n getInput(46),getInput(47),getInput(48),getInput(49),getInput(50),getInput(51),getInput(52),\r\n getInput(53),getInput(54),getInput(55),getInput(56),getInput(57),getInput(58),getInput(59),\r\n getInput(60),getInput(61),getInput(62),getInput(63),getInput(64),getInput(65),getInput(66)\r\n ,getInput(67));\r\n And carry=new And(\"carry\",adder.getOutput(0),Simulator.trueLogic);\r\n\r\n Link[] inp = new Link[32];\r\n int i=4;\r\n for (int j=0; j<32 ; j++){\r\n inp[j] = getInput(i) ;\r\n i++;\r\n }\r\n\r\n Twos_complement tws =new Twos_complement(\"tws\",\"32X32\",inp);\r\n\r\n Adder sub =new Adder(\"sub\",\"64X33\",\r\n tws.getOutput(0),tws.getOutput(1),tws.getOutput(2),tws.getOutput(3),tws.getOutput(4),tws.getOutput(5),\r\n tws.getOutput(6),tws.getOutput(7),tws.getOutput(8),tws.getOutput(9),tws.getOutput(10),tws.getOutput(11),\r\n tws.getOutput(12),tws.getOutput(13),tws.getOutput(14),tws.getOutput(15),tws.getOutput(16),tws.getOutput(17),\r\n tws.getOutput(18),tws.getOutput(19),tws.getOutput(20),tws.getOutput(21),tws.getOutput(22),tws.getOutput(23),\r\n tws.getOutput(24),tws.getOutput(25),tws.getOutput(26),tws.getOutput(27),tws.getOutput(28),tws.getOutput(29),\r\n tws.getOutput(30),tws.getOutput(31)\r\n ,getInput(36),getInput(37),getInput(38),\r\n getInput(39),getInput(40),getInput(41),getInput(42),getInput(43),getInput(44),getInput(45),\r\n getInput(46),getInput(47),getInput(48),getInput(49),getInput(50),getInput(51),getInput(52),\r\n getInput(53),getInput(54),getInput(55),getInput(56),getInput(57),getInput(58),getInput(59),\r\n getInput(60),getInput(61),getInput(62),getInput(63),getInput(64),getInput(65),getInput(66)\r\n ,getInput(67));\r\n\r\n And and0= new And(\"and0\",getInput(4),getInput(36),CAnd.getOutput(0));\r\n And and1= new And(\"and1\",getInput(5),getInput(37),CAnd.getOutput(0));\r\n And and2= new And(\"and2\",getInput(6),getInput(38),CAnd.getOutput(0));\r\n And and3= new And(\"and3\",getInput(7),getInput(39),CAnd.getOutput(0));\r\n And and4= new And(\"and4\",getInput(8),getInput(40),CAnd.getOutput(0));\r\n And and5= new And(\"and6\",getInput(9),getInput(41),CAnd.getOutput(0));\r\n And and6= new And(\"and7\",getInput(10),getInput(42),CAnd.getOutput(0));\r\n And and7= new And(\"and8\",getInput(11),getInput(43),CAnd.getOutput(0));\r\n And and8= new And(\"and9\",getInput(12),getInput(44),CAnd.getOutput(0));\r\n And and9= new And(\"and10\",getInput(13),getInput(45),CAnd.getOutput(0));\r\n And and10= new And(\"and11\",getInput(14),getInput(46),CAnd.getOutput(0));\r\n And and11= new And(\"and12\",getInput(15),getInput(47),CAnd.getOutput(0));\r\n And and12= new And(\"and13\",getInput(16),getInput(48),CAnd.getOutput(0));\r\n And and13= new And(\"and14\",getInput(17),getInput(49),CAnd.getOutput(0));\r\n And and14= new And(\"and15\",getInput(18),getInput(50),CAnd.getOutput(0));\r\n And and15= new And(\"and16\",getInput(19),getInput(51),CAnd.getOutput(0));\r\n And and16= new And(\"and17\",getInput(20),getInput(52),CAnd.getOutput(0));\r\n And and17= new And(\"and18\",getInput(21),getInput(53),CAnd.getOutput(0));\r\n And and18= new And(\"and19\",getInput(22),getInput(54),CAnd.getOutput(0));\r\n And and19= new And(\"and20\",getInput(23),getInput(55),CAnd.getOutput(0));\r\n And and20= new And(\"and21\",getInput(24),getInput(56),CAnd.getOutput(0));\r\n And and21= new And(\"and22\",getInput(25),getInput(57),CAnd.getOutput(0));\r\n And and22= new And(\"and23\",getInput(26),getInput(58),CAnd.getOutput(0));\r\n And and23= new And(\"and24\",getInput(27),getInput(59),CAnd.getOutput(0));\r\n And and24= new And(\"and25\",getInput(28),getInput(60),CAnd.getOutput(0));\r\n And and25= new And(\"and26\",getInput(29),getInput(61),CAnd.getOutput(0));\r\n And and26= new And(\"and26\",getInput(30),getInput(62),CAnd.getOutput(0));\r\n And and27= new And(\"and27\",getInput(31),getInput(63),CAnd.getOutput(0));\r\n And and28= new And(\"and28\",getInput(32),getInput(64),CAnd.getOutput(0));\r\n And and29= new And(\"and29\",getInput(33),getInput(65),CAnd.getOutput(0));\r\n And and30= new And(\"and30\",getInput(34),getInput(66),CAnd.getOutput(0));\r\n And and31= new And(\"and31\",getInput(35),getInput(67),CAnd.getOutput(0));\r\n\r\n Or or0= new Or(\"and0\",getInput(4),getInput(36));\r\n Or or1= new Or(\"and1\",getInput(5),getInput(37));\r\n Or or2= new Or(\"and2\",getInput(6),getInput(38));\r\n Or or3= new Or(\"and3\",getInput(7),getInput(39));\r\n Or or4= new Or(\"and4\",getInput(8),getInput(40));\r\n Or or5= new Or(\"and6\",getInput(9),getInput(41));\r\n Or or6= new Or(\"and7\",getInput(10),getInput(42));\r\n Or or7= new Or(\"and8\",getInput(11),getInput(43));\r\n Or or8= new Or(\"and9\",getInput(12),getInput(44));\r\n Or or9= new Or(\"and10\",getInput(13),getInput(45));\r\n Or or10= new Or(\"and11\",getInput(14),getInput(46));\r\n Or or11= new Or(\"and12\",getInput(15),getInput(47));\r\n Or or12= new Or(\"and13\",getInput(16),getInput(48));\r\n Or or13= new Or(\"and14\",getInput(17),getInput(49));\r\n Or or14= new Or(\"and15\",getInput(18),getInput(50));\r\n Or or15= new Or(\"and16\",getInput(19),getInput(51));\r\n Or or16= new Or(\"and17\",getInput(20),getInput(52));\r\n Or or17= new Or(\"and18\",getInput(21),getInput(53));\r\n Or or18= new Or(\"and19\",getInput(22),getInput(54));\r\n Or or19= new Or(\"and20\",getInput(23),getInput(55));\r\n Or or20= new Or(\"and21\",getInput(24),getInput(56));\r\n Or or21= new Or(\"and22\",getInput(25),getInput(57));\r\n Or or22= new Or(\"and23\",getInput(26),getInput(58));\r\n Or or23= new Or(\"and24\",getInput(27),getInput(59));\r\n Or or24= new Or(\"and25\",getInput(28),getInput(60));\r\n Or or25= new Or(\"and26\",getInput(29),getInput(61));\r\n Or or26= new Or(\"and26\",getInput(30),getInput(62));\r\n Or or27= new Or(\"and27\",getInput(31),getInput(63));\r\n Or or28= new Or(\"and28\",getInput(32),getInput(64));\r\n Or or29= new Or(\"and29\",getInput(33),getInput(65));\r\n Or or30= new Or(\"and30\",getInput(34),getInput(66));\r\n Or or31= new Or(\"and31\",getInput(35),getInput(67));\r\n\r\n And Add1 =new And(\"radd1\",adder.getOutput(1),CAdd.getOutput(0));\r\n And Add2 =new And(\"radd2\",adder.getOutput(2),CAdd.getOutput(0));\r\n And Add3 =new And(\"radd3\",adder.getOutput(3),CAdd.getOutput(0));\r\n And Add4 =new And(\"radd4\",adder.getOutput(4),CAdd.getOutput(0));\r\n And Add5 =new And(\"radd5\",adder.getOutput(5),CAdd.getOutput(0));\r\n And Add6 =new And(\"radd6\",adder.getOutput(6),CAdd.getOutput(0));\r\n And Add7 =new And(\"radd7\",adder.getOutput(7),CAdd.getOutput(0));\r\n And Add8 =new And(\"radd8\",adder.getOutput(8),CAdd.getOutput(0));\r\n And Add9 =new And(\"radd9\",adder.getOutput(9),CAdd.getOutput(0));\r\n And Add10 =new And(\"radd10\",adder.getOutput(10),CAdd.getOutput(0));\r\n And Add11 =new And(\"radd11\",adder.getOutput(11),CAdd.getOutput(0));\r\n And Add12 =new And(\"radd12\",adder.getOutput(12),CAdd.getOutput(0));\r\n And Add13 =new And(\"radd13\",adder.getOutput(13),CAdd.getOutput(0));\r\n And Add14 =new And(\"radd14\",adder.getOutput(14),CAdd.getOutput(0));\r\n And Add15 =new And(\"radd15\",adder.getOutput(15),CAdd.getOutput(0));\r\n And Add16 =new And(\"radd16\",adder.getOutput(16),CAdd.getOutput(0));\r\n And Add17 =new And(\"radd17\",adder.getOutput(17),CAdd.getOutput(0));\r\n And Add18 =new And(\"radd18\",adder.getOutput(18),CAdd.getOutput(0));\r\n And Add19 =new And(\"radd19\",adder.getOutput(19),CAdd.getOutput(0));\r\n And Add20 =new And(\"radd20\",adder.getOutput(20),CAdd.getOutput(0));\r\n And Add21 =new And(\"radd21\",adder.getOutput(21),CAdd.getOutput(0));\r\n And Add22 =new And(\"radd22\",adder.getOutput(22),CAdd.getOutput(0));\r\n And Add23 =new And(\"radd23\",adder.getOutput(23),CAdd.getOutput(0));\r\n And Add24 =new And(\"radd24\",adder.getOutput(24),CAdd.getOutput(0));\r\n And Add25 =new And(\"radd25\",adder.getOutput(25),CAdd.getOutput(0));\r\n And Add26 =new And(\"radd26\",adder.getOutput(26),CAdd.getOutput(0));\r\n And Add27 =new And(\"radd27\",adder.getOutput(27),CAdd.getOutput(0));\r\n And Add28 =new And(\"radd28\",adder.getOutput(28),CAdd.getOutput(0));\r\n And Add29 =new And(\"radd29\",adder.getOutput(29),CAdd.getOutput(0));\r\n And Add30 =new And(\"radd30\",adder.getOutput(30),CAdd.getOutput(0));\r\n And Add31 =new And(\"radd31\",adder.getOutput(31),CAdd.getOutput(0));\r\n And Add32 =new And(\"radd32\",adder.getOutput(32),CAdd.getOutput(0));\r\n\r\n\r\n And Sub1 =new And(\"sub0\",CSub.getOutput(0),sub.getOutput(1));\r\n And Sub2 =new And(\"sub1\",CSub.getOutput(0),sub.getOutput(2));\r\n And Sub3 =new And(\"sub2\",CSub.getOutput(0),sub.getOutput(3));\r\n And Sub4 =new And(\"sub3\",CSub.getOutput(0),sub.getOutput(4));\r\n And Sub5 =new And(\"sub4\",CSub.getOutput(0),sub.getOutput(5));\r\n And Sub6 =new And(\"sub5\",CSub.getOutput(0),sub.getOutput(6));\r\n And Sub7 =new And(\"sub6\",CSub.getOutput(0),sub.getOutput(7));\r\n And Sub8 =new And(\"sub7\",CSub.getOutput(0),sub.getOutput(8));\r\n And Sub9 =new And(\"sub8\",CSub.getOutput(0),sub.getOutput(9));\r\n And Sub10 =new And(\"sub9\",CSub.getOutput(0),sub.getOutput(10));\r\n And Sub11 =new And(\"sub10\",CSub.getOutput(0),sub.getOutput(11));\r\n And Sub12 =new And(\"sub11\",CSub.getOutput(0),sub.getOutput(12));\r\n And Sub13 =new And(\"sub12\",CSub.getOutput(0),sub.getOutput(13));\r\n And Sub14 =new And(\"sub13\",CSub.getOutput(0),sub.getOutput(14));\r\n And Sub15 =new And(\"sub14\",CSub.getOutput(0),sub.getOutput(15));\r\n And Sub16 =new And(\"sub15\",CSub.getOutput(0),sub.getOutput(16));\r\n And Sub17 =new And(\"sub16\",CSub.getOutput(0),sub.getOutput(17));\r\n And Sub18 =new And(\"sub17\",CSub.getOutput(0),sub.getOutput(18));\r\n And Sub19 =new And(\"sub18\",CSub.getOutput(0),sub.getOutput(19));\r\n And Sub20 =new And(\"sub19\",CSub.getOutput(0),sub.getOutput(20));\r\n And Sub21 =new And(\"sub20\",CSub.getOutput(0),sub.getOutput(21));\r\n And Sub22 =new And(\"sub21\",CSub.getOutput(0),sub.getOutput(22));\r\n And Sub23 =new And(\"sub22\",CSub.getOutput(0),sub.getOutput(23));\r\n And Sub24 =new And(\"sub23\",CSub.getOutput(0),sub.getOutput(24));\r\n And Sub25 =new And(\"sub24\",CSub.getOutput(0),sub.getOutput(25));\r\n And Sub26 =new And(\"sub25\",CSub.getOutput(0),sub.getOutput(26));\r\n And Sub27 =new And(\"sub26\",CSub.getOutput(0),sub.getOutput(27));\r\n And Sub28 =new And(\"sub27\",CSub.getOutput(0),sub.getOutput(28));\r\n And Sub29 =new And(\"sub28\",CSub.getOutput(0),sub.getOutput(29));\r\n And Sub30 =new And(\"sub29\",CSub.getOutput(0),sub.getOutput(30));\r\n And Sub31 =new And(\"sub30\",CSub.getOutput(0),sub.getOutput(31));\r\n And Sub32 =new And(\"sub31\",CSub.getOutput(0),sub.getOutput(32));\r\n\r\n And Or1= new And(\"or0\",COr.getOutput(0),or0.getOutput(0));\r\n And Or2= new And(\"or1\",COr.getOutput(0),or1.getOutput(0));\r\n And Or3= new And(\"or2\",COr.getOutput(0),or2.getOutput(0));\r\n And Or4= new And(\"or3\",COr.getOutput(0),or3.getOutput(0));\r\n And Or5= new And(\"or4\",COr.getOutput(0),or4.getOutput(0));\r\n And Or6= new And(\"or5\",COr.getOutput(0),or5.getOutput(0));\r\n And Or7= new And(\"or6\",COr.getOutput(0),or6.getOutput(0));\r\n And Or8= new And(\"or7\",COr.getOutput(0),or7.getOutput(0));\r\n And Or9= new And(\"or8\",COr.getOutput(0),or8.getOutput(0));\r\n And Or10= new And(\"or9\",COr.getOutput(0),or9.getOutput(0));\r\n And Or11= new And(\"or10\",COr.getOutput(0),or10.getOutput(0));\r\n And Or12= new And(\"or11\",COr.getOutput(0),or11.getOutput(0));\r\n And Or13= new And(\"or12\",COr.getOutput(0),or12.getOutput(0));\r\n And Or14= new And(\"or13\",COr.getOutput(0),or13.getOutput(0));\r\n And Or15= new And(\"or14\",COr.getOutput(0),or14.getOutput(0));\r\n And Or16= new And(\"or15\",COr.getOutput(0),or15.getOutput(0));\r\n And Or17= new And(\"or16\",COr.getOutput(0),or16.getOutput(0));\r\n And Or18= new And(\"or17\",COr.getOutput(0),or17.getOutput(0));\r\n And Or19= new And(\"or18\",COr.getOutput(0),or18.getOutput(0));\r\n And Or20= new And(\"or19\",COr.getOutput(0),or19.getOutput(0));\r\n And Or21= new And(\"or20\",COr.getOutput(0),or20.getOutput(0));\r\n And Or22= new And(\"or21\",COr.getOutput(0),or21.getOutput(0));\r\n And Or23= new And(\"or22\",COr.getOutput(0),or22.getOutput(0));\r\n And Or24= new And(\"or23\",COr.getOutput(0),or23.getOutput(0));\r\n And Or25= new And(\"or24\",COr.getOutput(0),or24.getOutput(0));\r\n And Or26= new And(\"or25\",COr.getOutput(0),or25.getOutput(0));\r\n And Or27= new And(\"or26\",COr.getOutput(0),or26.getOutput(0));\r\n And Or28= new And(\"or27\",COr.getOutput(0),or27.getOutput(0));\r\n And Or29= new And(\"or28\",COr.getOutput(0),or28.getOutput(0));\r\n And Or30= new And(\"or29\",COr.getOutput(0),or29.getOutput(0));\r\n And Or31= new And(\"or30\",COr.getOutput(0),or30.getOutput(0));\r\n And Or32= new And(\"or31\",COr.getOutput(0),or31.getOutput(0));\r\n\r\n Not notx0=new Not(\"notx0\"\r\n ,\r\n getInput(4),getInput(5),getInput(6),getInput(7),getInput(8),getInput(9),getInput(10),\r\n getInput(11),getInput(12),getInput(13),getInput(14),getInput(15),getInput(16),getInput(17),\r\n getInput(18),getInput(19),getInput(20),getInput(21),getInput(22),getInput(23),getInput(24),\r\n getInput(25),getInput(26),getInput(27),getInput(28),getInput(29),getInput(30),getInput(31),\r\n getInput(32),getInput(33),getInput(34),getInput(35));\r\n\r\n And slt1=new And(\"slt1\",notx0.getOutput(0),getInput(36));\r\n And slt2=new And(\"slt2\",notx0.getOutput(1),getInput(37));\r\n And slt3=new And(\"slt3\",notx0.getOutput(2),getInput(38));\r\n And slt4=new And(\"slt4\",notx0.getOutput(3),getInput(39));\r\n And slt5=new And(\"slt5\",notx0.getOutput(4),getInput(40));\r\n And slt6=new And(\"slt6\",notx0.getOutput(5),getInput(41));\r\n And slt7=new And(\"slt7\",notx0.getOutput(6),getInput(42));\r\n And slt8=new And(\"slt8\",notx0.getOutput(7),getInput(43));\r\n And slt9=new And(\"slt9\",notx0.getOutput(8),getInput(44));\r\n And slt10=new And(\"slt10\",notx0.getOutput(9),getInput(45));\r\n And slt11=new And(\"slt11\",notx0.getOutput(10),getInput(46));\r\n And slt12=new And(\"slt12\",notx0.getOutput(11),getInput(47));\r\n And slt13=new And(\"slt13\",notx0.getOutput(12),getInput(48));\r\n And slt14=new And(\"slt14\",notx0.getOutput(13),getInput(49));\r\n And slt15=new And(\"slt15\",notx0.getOutput(14),getInput(50));\r\n And slt16=new And(\"slt16\",notx0.getOutput(15),getInput(51));\r\n And slt17=new And(\"slt17\",notx0.getOutput(16),getInput(52));\r\n And slt18=new And(\"slt18\",notx0.getOutput(17),getInput(53));\r\n And slt19=new And(\"slt19\",notx0.getOutput(18),getInput(54));\r\n And slt20=new And(\"slt20\",notx0.getOutput(19),getInput(55));\r\n And slt21=new And(\"slt21\",notx0.getOutput(20),getInput(56));\r\n And slt22=new And(\"slt22\",notx0.getOutput(21),getInput(57));\r\n And slt23=new And(\"slt23\",notx0.getOutput(22),getInput(58));\r\n And slt24=new And(\"slt24\",notx0.getOutput(23),getInput(59));\r\n And slt25=new And(\"slt25\",notx0.getOutput(24),getInput(60));\r\n And slt26=new And(\"slt26\",notx0.getOutput(25),getInput(61));\r\n And slt27=new And(\"slt27\",notx0.getOutput(26),getInput(62));\r\n And slt28=new And(\"slt28\",notx0.getOutput(27),getInput(63));\r\n And slt29=new And(\"slt29\",notx0.getOutput(28),getInput(64));\r\n And slt30=new And(\"slt30\",notx0.getOutput(29),getInput(65));\r\n And slt31=new And(\"slt31\",notx0.getOutput(30),getInput(66));\r\n And slt32=new And(\"slt32\",notx0.getOutput(31),getInput(67));\r\n\r\n Or Sltrez=new Or(\"Sltrez\",\r\n slt1.getOutput(0),slt2.getOutput(0),slt3.getOutput(0),slt4.getOutput(0),slt5.getOutput(0),\r\n slt6.getOutput(0),slt7.getOutput(0),slt8.getOutput(0),slt9.getOutput(0),slt10.getOutput(0),\r\n slt11.getOutput(0),slt12.getOutput(0),slt13.getOutput(0),slt14.getOutput(0),slt15.getOutput(0),\r\n slt16.getOutput(0),slt17.getOutput(0),slt18.getOutput(0),slt19.getOutput(0),slt20.getOutput(0),\r\n slt21.getOutput(0),slt22.getOutput(0),slt23.getOutput(0),slt24.getOutput(0),slt25.getOutput(0),\r\n slt26.getOutput(0),slt27.getOutput(0),slt28.getOutput(0),slt29.getOutput(0),slt30.getOutput(0),\r\n slt31.getOutput(0),slt32.getOutput(0));\r\n And Sltresult= new And(\"rezult\",CSlt.getOutput(0),Sltrez.getOutput(0));\r\n\r\n Or r1=new Or(\"r1\",Add1.getOutput(0),and0.getOutput(0),Or1.getOutput(0),Sub1.getOutput(0));\r\n Or r2=new Or(\"r2\",Add2.getOutput(0),and1.getOutput(0),Or2.getOutput(0),Sub2.getOutput(0));\r\n Or r3=new Or(\"r3\",Add3.getOutput(0),and2.getOutput(0),Or3.getOutput(0),Sub3.getOutput(0));\r\n Or r4=new Or(\"r4\",Add4.getOutput(0),and3.getOutput(0),Or4.getOutput(0),Sub4.getOutput(0));\r\n Or r5=new Or(\"r5\",Add5.getOutput(0),and4.getOutput(0),Or5.getOutput(0),Sub5.getOutput(0));\r\n Or r6=new Or(\"r6\",Add6.getOutput(0),and5.getOutput(0),Or6.getOutput(0),Sub6.getOutput(0));\r\n Or r7=new Or(\"r7\",Add7.getOutput(0),and6.getOutput(0),Or7.getOutput(0),Sub7.getOutput(0));\r\n Or r8=new Or(\"r8\",Add8.getOutput(0),and7.getOutput(0),Or8.getOutput(0),Sub8.getOutput(0));\r\n Or r9=new Or(\"r9\",Add9.getOutput(0),and8.getOutput(0),Or9.getOutput(0),Sub9.getOutput(0));\r\n Or r10=new Or(\"r10\",Add10.getOutput(0),and9.getOutput(0),Or10.getOutput(0),Sub10.getOutput(0));\r\n Or r11=new Or(\"r11\",Add11.getOutput(0),and10.getOutput(0),Or11.getOutput(0),Sub11.getOutput(0));\r\n Or r12=new Or(\"r12\",Add12.getOutput(0),and11.getOutput(0),Or12.getOutput(0),Sub12.getOutput(0));\r\n Or r13=new Or(\"r13\",Add13.getOutput(0),and12.getOutput(0),Or13.getOutput(0),Sub13.getOutput(0));\r\n Or r14=new Or(\"r14\",Add14.getOutput(0),and13.getOutput(0),Or14.getOutput(0),Sub14.getOutput(0));\r\n Or r15=new Or(\"r15\",Add15.getOutput(0),and14.getOutput(0),Or15.getOutput(0),Sub15.getOutput(0));\r\n Or r16=new Or(\"r16\",Add16.getOutput(0),and15.getOutput(0),Or16.getOutput(0),Sub16.getOutput(0));\r\n Or r17=new Or(\"r17\",Add17.getOutput(0),and16.getOutput(0),Or17.getOutput(0),Sub17.getOutput(0));\r\n Or r18=new Or(\"r18\",Add18.getOutput(0),and17.getOutput(0),Or18.getOutput(0),Sub18.getOutput(0));\r\n Or r19=new Or(\"r19\",Add19.getOutput(0),and18.getOutput(0),Or19.getOutput(0),Sub19.getOutput(0));\r\n Or r20=new Or(\"r20\",Add20.getOutput(0),and19.getOutput(0),Or20.getOutput(0),Sub20.getOutput(0));\r\n Or r21=new Or(\"r21\",Add21.getOutput(0),and20.getOutput(0),Or21.getOutput(0),Sub21.getOutput(0));\r\n Or r22=new Or(\"r22\",Add22.getOutput(0),and21.getOutput(0),Or22.getOutput(0),Sub22.getOutput(0));\r\n Or r23=new Or(\"r23\",Add23.getOutput(0),and22.getOutput(0),Or23.getOutput(0),Sub23.getOutput(0));\r\n Or r24=new Or(\"r24\",Add24.getOutput(0),and23.getOutput(0),Or24.getOutput(0),Sub24.getOutput(0));\r\n Or r25=new Or(\"r25\",Add25.getOutput(0),and24.getOutput(0),Or25.getOutput(0),Sub25.getOutput(0));\r\n Or r26=new Or(\"r26\",Add26.getOutput(0),and25.getOutput(0),Or26.getOutput(0),Sub26.getOutput(0));\r\n Or r27=new Or(\"r27\",Add27.getOutput(0),and26.getOutput(0),Or27.getOutput(0),Sub27.getOutput(0));\r\n Or r28=new Or(\"r28\",Add28.getOutput(0),and27.getOutput(0),Or28.getOutput(0),Sub28.getOutput(0));\r\n Or r29=new Or(\"r29\",Add29.getOutput(0),and28.getOutput(0),Or29.getOutput(0),Sub29.getOutput(0));\r\n Or r30=new Or(\"r30\",Add30.getOutput(0),and29.getOutput(0),Or30.getOutput(0),Sub30.getOutput(0));\r\n Or r31=new Or(\"r31\",Add31.getOutput(0),and30.getOutput(0),Or31.getOutput(0),Sub31.getOutput(0));\r\n Or r32=new Or(\"r32\",Add32.getOutput(0),and31.getOutput(0),Or32.getOutput(0),Sub32.getOutput(0),Sltresult.getOutput(0));\r\n\r\n\r\n\r\n Or zerot=new Or(\"orzerot\",\r\n r1.getOutput(0),r2.getOutput(0),r3.getOutput(0),r4.getOutput(0),r5.getOutput(0),r6.getOutput(0),\r\n r7.getOutput(0),r8.getOutput(0),r9.getOutput(0),r10.getOutput(0),r11.getOutput(0),r12.getOutput(0),\r\n r13.getOutput(0),r14.getOutput(0),r15.getOutput(0),r16.getOutput(0),r17.getOutput(0),r18.getOutput(0),\r\n r19.getOutput(0),r20.getOutput(0),r21.getOutput(0),r22.getOutput(0),r23.getOutput(0),r25.getOutput(0),\r\n r26.getOutput(0),r27.getOutput(0),r28.getOutput(0),r29.getOutput(0),r30.getOutput(0),r31.getOutput(0),\r\n r32.getOutput(0),r24.getOutput(0));\r\n Not zero=new Not(\"zero\",zerot.getOutput(0));\r\n addOutput(zero.getOutput(0),r1.getOutput(0),r2.getOutput(0),r3.getOutput(0),r4.getOutput(0),r5.getOutput(0),r6.getOutput(0),\r\n r7.getOutput(0),r8.getOutput(0),r9.getOutput(0),r10.getOutput(0),r11.getOutput(0),r12.getOutput(0),\r\n r13.getOutput(0),r14.getOutput(0),r15.getOutput(0),r16.getOutput(0),r17.getOutput(0),r18.getOutput(0),\r\n r19.getOutput(0),r20.getOutput(0),r21.getOutput(0),r22.getOutput(0),r23.getOutput(0),r24.getOutput(0),\r\n r25.getOutput(0), r26.getOutput(0),r27.getOutput(0),r28.getOutput(0),r29.getOutput(0),r30.getOutput(0),\r\n r31.getOutput(0),\r\n r32.getOutput(0));\r\n\r\n }\r\n}
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- src/simulator/wrapper/wrappers/ALU.java (revision 679e8f8590ac81343d8c383e82523219b4608d18)
++++ src/simulator/wrapper/wrappers/ALU.java (date 1595652219298)
+@@ -60,7 +60,7 @@
+ i++;
+ }
+
+- Twos_complement tws =new Twos_complement("tws","32X32",inp);
++ TwosComplement tws =new TwosComplement("tws","32X32",inp);
+
+ Adder sub =new Adder("sub","64X33",
+ tws.getOutput(0),tws.getOutput(1),tws.getOutput(2),tws.getOutput(3),tws.getOutput(4),tws.getOutput(5),
diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_34_AM__Default_Changelist_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_34_AM__Default_Changelist_.xml
new file mode 100644
index 0000000..137430d
--- /dev/null
+++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_34_AM__Default_Changelist_.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_38_AM_[Default_Changelist]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_38_AM_[Default_Changelist]/shelved.patch
new file mode 100644
index 0000000..8fe7646
--- /dev/null
+++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_38_AM_[Default_Changelist]/shelved.patch
@@ -0,0 +1,46 @@
+Index: src/simulator/Sample.java
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
+<+>//Dedicated to Goli\r\n\r\npackage simulator;\r\n\r\nimport simulator.control.Simulator;\r\nimport simulator.gates.combinational.Not;\r\nimport simulator.gates.sequential.Clock;\r\n\r\nimport simulator.network.Link;\r\nimport simulator.wrapper.wrappers.*;\r\n\r\nimport java.util.List;\r\n\r\npublic class Sample {\r\n public static void main(String[] args) {\r\n \t\r\n //sample circuit\r\n \t\r\n \t\r\n// And a1 = new And(\"AND1\");\r\n// a1.addInput(Simulator.trueLogic , Simulator.falseLogic);\r\n// \r\n// Or o1 = new Or(\"OR1\");\r\n// o1.addInput(a1.getOutput(0) , Simulator.falseLogic);\r\n \r\n //HalfAdder ha1 = new HalfAdder(\"HALFADDER1\", \"2X2\" );\r\n //ha1.addInput(Simulator.trueLogic , Simulator.trueLogic);\r\n \t\r\n \t//FullAdder fa1 = new FullAdder(\"FULLADDER1\", \"3X2\");\r\n \t//fa1.addInput(Simulator.trueLogic , Simulator.falseLogic , Simulator.trueLogic);\r\n \t\r\n \t//Clock clock1 = new Clock(\"CLOCK1\", 1000) ;\r\n \t//DFlipFlop d1 = new DFlipFlop(\"DF1\", clock1.getOutput(0) , Simulator.trueLogic) ;\r\n \t\r\n// \tLink[] inp = new Link[16];\r\n// \tfor (int j = 0 ; j<5 ; j++)\r\n// \t\tinp[j] = Simulator.trueLogic ;\r\n// \tfor (int j = 5 ; j<16 ; j++)\r\n// \t\tinp[j] = Simulator.falseLogic ;\r\n// \t\t\r\n// \tSignExtend se1 = new SignExtend(\"SIGNEX\", \"16X32\", inp);\r\n \t\r\n \t\r\n //Multiplexer2x1 m1 = new Multiplexer2x1(\"MUX_2x1\",\"3X1\",Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic);\r\n// Multiplexer4x1 m1 = new Multiplexer2x1(\"MUX_2x1\",\"6X1\",Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic);\r\n//\r\n\r\n// Multiplexer8x1 m1 = new Multiplexer8x1(\"MUX_8x1\",\"11x1\",Simulator.trueLogic,Simulator.falseLogic , Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.trueLogic);\r\n\r\n// \tLink[] inp = new Link[32];\r\n// \tfor (int j=0 ; j<32 ; j++)\r\n// \t\tinp[j] = Simulator.trueLogic ;\r\n//\r\n// \tTwos_complement tc1 = new Twos_complement(\"TWO's\",\"32X32\",inp);\r\n \t\r\n \t\r\n \t\r\n Clock clock = new Clock(\"CLOCK\", 1000);\r\n// \tClock c = new Clock(\"clk\", 1000);\r\n// \tDFlipFlop d = new DFlipFlop(\"DFlipFlop\",\"2X2\",c.getOutput(0));\r\n// \td.addInput(d.getOutput(1));\r\n \r\n \r\n \t//assume that the first address of PC is (00000000) in hex\r\n \tLink[] PCinput = new Link[78];\r\n \tPCinput[0] = clock.getOutput(0) ;\r\n \tfor (int j=1 ; j<33 ; j++)\r\n \t\tPCinput[j] = Simulator.falseLogic ; // first PC address\r\n \tfor (int j=33 ; j<49 ; j++)\r\n \t\tPCinput[j] = Simulator.falseLogic ; // beq offset\r\n \tfor (int j=49 ; j<75 ; j++)\r\n \t PCinput[j] = Simulator.falseLogic ; // jmp offset\r\n \t\r\n \tPCinput[75] = Simulator.falseLogic ; // zero flag\r\n \tPCinput[76] = Simulator.falseLogic ; // beq flag\r\n \tPCinput[77] = Simulator.falseLogic ; // jmp flag\r\n\r\n \t\r\n \tPC_update pcUpdate = new PC_update(\"PC_UPDATE\",\"78X32\",PCinput);\r\n \t\r\n \t\r\n \t\r\n Simulator.debugger.addTrackItem(pcUpdate);\r\n Simulator.debugger.setDelay(200);\r\n Simulator.circuit.startCircuit();\r\n\r\n \t\r\n \t\r\n }\r\n}\r\n\r\n
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- src/simulator/Sample.java (revision 9bc634603341161497ad1e96f650d19854ff3e81)
++++ src/simulator/Sample.java (date 1595653499545)
+@@ -62,21 +62,21 @@
+
+
+ //assume that the first address of PC is (00000000) in hex
+- Link[] PCinput = new Link[78];
+- PCinput[0] = clock.getOutput(0) ;
+- for (int j=1 ; j<33 ; j++)
+- PCinput[j] = Simulator.falseLogic ; // first PC address
+- for (int j=33 ; j<49 ; j++)
+- PCinput[j] = Simulator.falseLogic ; // beq offset
+- for (int j=49 ; j<75 ; j++)
+- PCinput[j] = Simulator.falseLogic ; // jmp offset
+-
+- PCinput[75] = Simulator.falseLogic ; // zero flag
+- PCinput[76] = Simulator.falseLogic ; // beq flag
+- PCinput[77] = Simulator.falseLogic ; // jmp flag
+-
+-
+- PC_update pcUpdate = new PC_update("PC_UPDATE","78X32",PCinput);
++// Link[] PCinput = new Link[78];
++// PCinput[0] = clock.getOutput(0) ;
++// for (int j=1 ; j<33 ; j++)
++// PCinput[j] = Simulator.falseLogic ; // first PC address
++// for (int j=33 ; j<49 ; j++)
++// PCinput[j] = Simulator.falseLogic ; // beq offset
++// for (int j=49 ; j<75 ; j++)
++// PCinput[j] = Simulator.falseLogic ; // jmp offset
++//
++// PCinput[75] = Simulator.falseLogic ; // zero flag
++// PCinput[76] = Simulator.falseLogic ; // beq flag
++// PCinput[77] = Simulator.falseLogic ; // jmp flag
++//
++//
++// PC_update pcUpdate = new PC_update("PC_UPDATE","78X32",PCinput);
+
+
+
diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_38_AM_[Default_Changelist]1/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_38_AM_[Default_Changelist]1/shelved.patch
new file mode 100644
index 0000000..e69de29
diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_38_AM__Default_Changelist_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_38_AM__Default_Changelist_.xml
new file mode 100644
index 0000000..a155abf
--- /dev/null
+++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_38_AM__Default_Changelist_.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_40_AM_[Default_Changelist]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_40_AM_[Default_Changelist]/shelved.patch
new file mode 100644
index 0000000..9acb751
--- /dev/null
+++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_40_AM_[Default_Changelist]/shelved.patch
@@ -0,0 +1,64 @@
+Index: src/simulator/Sample.java
+IDEA additional info:
+Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
+<+>//Dedicated to Goli\r\n\r\npackage simulator;\r\n\r\nimport simulator.control.Simulator;\r\nimport simulator.gates.combinational.Memory;\r\nimport simulator.gates.sequential.Clock;\r\nimport simulator.network.Link;\r\nimport simulator.wrapper.wrappers.*;\r\n\r\npublic class Sample {\r\n public static void main(String[] args) {\r\n //sample circuit\r\n// Adder adder = new Adder(\"ADDER\", \"10X6\",\r\n// Simulator.falseLogic, Simulator.trueLogic, Simulator.trueLogic, Simulator.falseLogic, Simulator.trueLogic,\r\n// Simulator.falseLogic, Simulator.trueLogic, Simulator.falseLogic, Simulator.falseLogic, Simulator.trueLogic);\r\n\r\n// Multiplexer2x1 m1 = new Multiplexer2x1(\"MUX_2x1\",\"3X1\",Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic);\r\n// Multiplexer4x1 m1 = new Multiplexer2x1(\"MUX_2x1\",\"6X1\",Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic);\r\n//\r\n//\r\n// Multiplexer8x1 m1 = new Multiplexer8x1(\"MUX_8x1\",\"11x1\",Simulator.trueLogic,Simulator.falseLogic , Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.trueLogic);\r\n\r\n // ControlUnit cu = new ControlUnit(\"CU\", \"6X10\",Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.trueLogic); // lw\r\n // ControlUnit cu = new ControlUnit(\"CU\", \"6X10\",Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic);// R-format\r\n// ControlUnit cu = new ControlUnit(\"CU\", \"6X10\",Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic);// Jump\r\n\r\n// Decoder3X8 d0 = new Decoder3X8(\"Dec_0\",\"4X8\",Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.trueLogic);\r\n\r\n// Decoder5X32 d1 = new Decoder5X32(\"Dec_1\",\"5X32\",Simulator.trueLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic);\r\n\r\n//\r\n//\r\n// RegisterFile r = new RegisterFile(\"RegFile\",\"49x64\");\r\n//\r\n// Clock clock = new Clock(\"Clock\",1000);\r\n// Link write = Simulator.trueLogic;\r\n// Link []regWrite = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic};\r\n// Link []regRead1 = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic};\r\n// Link []regRead2 = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic};\r\n Link []regDataWrite = {Simulator.trueLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,\r\n Simulator.falseLogic, Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic, Simulator.falseLogic,\r\n Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,\r\n Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,\r\n Simulator.falseLogic, Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic, Simulator.falseLogic,\r\n Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic\r\n ,Simulator.trueLogic,Simulator.falseLogic};\r\n//\r\n// r.addInput(clock.getOutput(0));\r\n// r.addInput(write);\r\n// r.addInput(regWrite);\r\n// r.addInput(regRead1);\r\n// r.addInput(regRead2);\r\n// r.addInput(regDataWrite);\r\n\r\n// Multiplexer32x1 m = new Multiplexer32x1(\"MUX_32x1\",\"37x1\",Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic);\r\n//\r\n// m.addInput(regDataWrite);\r\n Clock c = new Clock(\"clk\",1000);\r\n DFlipFlop d = new DFlipFlop(\"DFlipFlop\",\"2x2\",c.getOutput(0));\r\n d.addInput(d.getOutput(1));\r\n Memory m = new Memory(\"mem\",d.getOutput(0));\r\n m.addInput(Simulator.trueLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,\r\n Simulator.falseLogic, Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic, Simulator.falseLogic,\r\n Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,\r\n Simulator.falseLogic);\r\n\r\n Link []regDataWrite2 = {c.getOutput(0),c.getOutput(0),c.getOutput(0),Simulator.falseLogic,Simulator.falseLogic,\r\n Simulator.falseLogic, Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic, Simulator.falseLogic,\r\n Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,\r\n Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,\r\n Simulator.falseLogic, Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic, Simulator.falseLogic,\r\n Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic\r\n ,Simulator.trueLogic,Simulator.falseLogic};\r\n\r\n\r\n\r\n m.addInput(regDataWrite2);\r\n\r\n\r\n Simulator.debugger.addTrackItem(m,c);\r\n Simulator.debugger.setDelay(500);\r\n Simulator.circuit.startCircuit();\r\n }\r\n}\r\n\r\n
+Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
+<+>UTF-8
+===================================================================
+--- src/simulator/Sample.java (revision 21049f5bba589c13a5e896d2afbf5bdacae106bd)
++++ src/simulator/Sample.java (date 1595653754911)
+@@ -29,15 +29,15 @@
+
+ // Decoder5X32 d1 = new Decoder5X32("Dec_1","5X32",Simulator.trueLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic);
+
+-//
+-//
+-// RegisterFile r = new RegisterFile("RegFile","49x64");
+-//
+-// Clock clock = new Clock("Clock",1000);
+-// Link write = Simulator.trueLogic;
+-// Link []regWrite = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic};
+-// Link []regRead1 = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic};
+-// Link []regRead2 = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic};
++
++
++ RegisterFile r = new RegisterFile("RegFile","49x64");
++
++ Clock clock = new Clock("Clock",1000);
++ Link write = Simulator.trueLogic;
++ Link []regWrite = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic};
++ Link []regRead1 = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic};
++ Link []regRead2 = {Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.trueLogic,Simulator.falseLogic};
+ Link []regDataWrite = {Simulator.trueLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,
+ Simulator.falseLogic, Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic, Simulator.falseLogic,
+ Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,
+@@ -45,13 +45,13 @@
+ Simulator.falseLogic, Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic, Simulator.falseLogic,
+ Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic,Simulator.falseLogic
+ ,Simulator.trueLogic,Simulator.falseLogic};
+-//
+-// r.addInput(clock.getOutput(0));
+-// r.addInput(write);
+-// r.addInput(regWrite);
+-// r.addInput(regRead1);
+-// r.addInput(regRead2);
+-// r.addInput(regDataWrite);
++
++ r.addInput(clock.getOutput(0));
++ r.addInput(write);
++ r.addInput(regWrite);
++ r.addInput(regRead1);
++ r.addInput(regRead2);
++ r.addInput(regDataWrite);
+
+ // Multiplexer32x1 m = new Multiplexer32x1("MUX_32x1","37x1",Simulator.trueLogic,Simulator.trueLogic,Simulator.trueLogic,Simulator.falseLogic,Simulator.falseLogic);
+ //
+@@ -78,7 +78,7 @@
+ m.addInput(regDataWrite2);
+
+
+- Simulator.debugger.addTrackItem(m,c);
++ Simulator.debugger.addTrackItem(r);
+ Simulator.debugger.setDelay(500);
+ Simulator.circuit.startCircuit();
+ }
diff --git a/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_40_AM__Default_Changelist_.xml b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_40_AM__Default_Changelist_.xml
new file mode 100644
index 0000000..fc8547b
--- /dev/null
+++ b/.idea/shelf/Uncommitted_changes_before_Checkout_at_7_25_2020_9_40_AM__Default_Changelist_.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/END b/END
new file mode 100644
index 0000000..e7b90af
--- /dev/null
+++ b/END
@@ -0,0 +1,11 @@
+[33mcommit 4b11e83f092564f001436625e313bf475a65324e[m[33m ([m[1;36mHEAD -> [m[1;32mmaster[m[33m, [m[1;31morigin/master[m[33m)[m
+Author: Sm_mE
+Date: Sat Jul 18 16:55:23 2020 +0430
+
+ Add Sm_mE branch
+
+[33mcommit 39d36f21b6cce6072b9c807eeb017abc5ce755cd[m[33m ([m[1;31morigin/Sm_mE[m[33m, [m[1;32mSm_mE[m[33m)[m
+Author: Sm_mE
+Date: Sat Jul 18 16:53:37 2020 +0430
+
+ start commit
diff --git a/out/production/CircuitSimulator/.idea/.gitignore b/out/production/CircuitSimulator/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/out/production/CircuitSimulator/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/out/production/CircuitSimulator/.idea/misc.xml b/out/production/CircuitSimulator/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/out/production/CircuitSimulator/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/.idea/modules.xml b/out/production/CircuitSimulator/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/out/production/CircuitSimulator/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/.idea/src.iml b/out/production/CircuitSimulator/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/out/production/CircuitSimulator/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/.idea/vcs.xml b/out/production/CircuitSimulator/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/out/production/CircuitSimulator/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/Processor.iml b/out/production/CircuitSimulator/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/out/production/CircuitSimulator/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/.idea/.gitignore b/out/production/CircuitSimulator/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/out/production/CircuitSimulator/out/production/Processor/.idea/misc.xml b/out/production/CircuitSimulator/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/.idea/modules.xml b/out/production/CircuitSimulator/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/.idea/src.iml b/out/production/CircuitSimulator/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/.idea/vcs.xml b/out/production/CircuitSimulator/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/META-INF/Processor.kotlin_module b/out/production/CircuitSimulator/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/out/production/CircuitSimulator/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/out/production/CircuitSimulator/out/production/Processor/Processor.iml b/out/production/CircuitSimulator/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/.gitignore b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/misc.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/modules.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/src.iml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/vcs.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/Processor.iml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/out/production/CircuitSimulator/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/.idea/.gitignore b/src/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/src/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/src/.idea/misc.xml b/src/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/src/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/.idea/modules.xml b/src/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/src/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/.idea/src.iml b/src/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/src/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/.idea/vcs.xml b/src/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/src/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Processor.iml b/src/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/src/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/.idea/.gitignore b/src/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/src/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/src/out/production/Processor/.idea/misc.xml b/src/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/src/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/.idea/modules.xml b/src/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/src/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/.idea/src.iml b/src/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/src/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/.idea/vcs.xml b/src/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/src/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/META-INF/Processor.kotlin_module b/src/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/src/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/src/out/production/Processor/Processor.iml b/src/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/src/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/.idea/.gitignore b/src/out/production/Processor/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/src/out/production/Processor/out/production/Processor/.idea/misc.xml b/src/out/production/Processor/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/.idea/modules.xml b/src/out/production/Processor/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/.idea/src.iml b/src/out/production/Processor/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/.idea/vcs.xml b/src/out/production/Processor/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module b/src/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/src/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/src/out/production/Processor/out/production/Processor/Processor.iml b/src/out/production/Processor/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module b/src/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/src/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml b/src/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
new file mode 100644
index 0000000..fff67ee
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
new file mode 100644
index 0000000..addc9b1
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/src.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module
new file mode 100644
index 0000000..a49347a
Binary files /dev/null and b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/META-INF/Processor.kotlin_module differ
diff --git a/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
new file mode 100644
index 0000000..b107a2d
--- /dev/null
+++ b/src/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/out/production/Processor/Processor.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/simulator/Processor.java b/src/simulator/Processor.java
new file mode 100644
index 0000000..ec0cc90
--- /dev/null
+++ b/src/simulator/Processor.java
@@ -0,0 +1,275 @@
+package simulator;
+
+import simulator.control.Simulator;
+import simulator.gates.combinational.ByteMemory;
+import simulator.gates.combinational.Memory;
+import simulator.gates.sequential.Clock;
+import simulator.network.Link;
+import simulator.wrapper.wrappers.*;
+
+public class Processor {
+ public static void main(String[] args) {
+ // Creating needed wrapper :
+
+ Clock clock = new Clock("Clock",1000);
+
+ PCUpdate pcUpdate = new PCUpdate("PCUpdate","78x32");
+
+ ByteMemory instructionMemory = new ByteMemory("InstructionMemory");
+
+ Multiplexer2x1 []registerFileInput = new Multiplexer2x1[5];
+ for (int i = 0 ; i < 5 ; i++)
+ registerFileInput[i] = new Multiplexer2x1("RegisterFileInput_"+i,"3x1");
+
+ ControlUnit controlUnit = new ControlUnit("ControlUnit","6X10");
+
+ RegisterFile registerFile = new RegisterFile("RegisterFile","49x64");
+
+ ALUControl aluControl = new ALUControl("ALUControl","8X4");
+
+ SignExtend immediate = new SignExtend("Immediate","16X32");
+
+ Multiplexer2x1 []aluInput = new Multiplexer2x1[32];
+ for (int i = 0 ; i < 32 ; i++)
+ aluInput[i] = new Multiplexer2x1("ALUInput_"+i,"3x1");
+
+ ALU alu = new ALU("ALU","68X33");
+
+ ByteMemory dataMemory = new ByteMemory("DataMemory");
+
+ Multiplexer2x1 []writeRegisterData = new Multiplexer2x1[32];
+ for (int i = 0 ; i < 32 ; i++)
+ writeRegisterData[i] = new Multiplexer2x1("WriteRegisterData_"+i,"3X1");
+
+ Multiplexer2x1 []writeRegisterDataSelect = new Multiplexer2x1[32];
+ for (int i = 0 ; i < 32 ; i++)
+ writeRegisterDataSelect[i] = new Multiplexer2x1("WriteRegisterDataSelect_"+i,"3X1");
+
+
+ DFlipFlop[] shift = new DFlipFlop[2];
+ shift[0] = new DFlipFlop("SH0","2X2",clock.getOutput(0), Simulator.falseLogic);
+ shift[1] = new DFlipFlop("SH1","2X2",clock.getOutput(0), shift[0].getOutput(0));
+
+
+ for (int i=0 ; i<32 ; ++i)
+ writeRegisterDataSelect[i].addInput(shift[1].getOutput(0),
+ writeRegisterData[i].getOutput(0),Simulator.falseLogic);
+
+
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Pushing instructions to instruction memory
+ Link []startAddress = new Link[32];
+ for( int i = 0 ; i < 30 ; i++)
+ startAddress[i] = Simulator.falseLogic;
+ startAddress[30] = Simulator.falseLogic;
+ startAddress[31] = Simulator.falseLogic;
+
+ Boolean [][]instrucions = new Boolean[65536][8];
+ // add instructions here
+
+
+ for(int i=0 ; i<65536 ; i++)
+ for(int j=0 ; j<8 ; j++)
+ instrucions[i][j] = true;
+
+ // add $t0,$zero,$zero
+ // sw $t0,0($t1)
+ // lw $t0,0($t1)
+
+ ////////////////////////////////////////////////////////
+
+ instrucions[0][0] = false; instrucions[0][1] = false;
+ instrucions[0][2] = false; instrucions[0][3] = false;
+ instrucions[0][4] = false; instrucions[0][5] = false;
+ instrucions[0][6] = false; instrucions[0][7] = false;
+
+ instrucions[1][0] = false; instrucions[1][1] = true;
+ instrucions[1][2] = false; instrucions[1][3] = false;
+ instrucions[1][4] = true; instrucions[1][5] = false;
+ instrucions[1][6] = false; instrucions[1][7] = false;
+
+ instrucions[2][0] = false; instrucions[2][1] = false;
+ instrucions[2][2] = false; instrucions[2][3] = true;
+ instrucions[2][4] = false; instrucions[2][5] = false;
+ instrucions[2][6] = false; instrucions[2][7] = false;
+
+ instrucions[3][0] = false; instrucions[3][1] = false;
+ instrucions[3][2] = true; instrucions[3][3] = false;
+ instrucions[3][4] = false; instrucions[3][5] = false;
+ instrucions[3][6] = true; instrucions[3][7] = false;
+
+ /////////////////////////////////////////////////////////
+
+//
+// instrucions[4][0] = true; instrucions[4][1] = false;
+// instrucions[4][2] = false; instrucions[4][3] = false;
+// instrucions[4][4] = true; instrucions[4][5] = true;
+// instrucions[4][6] = false; instrucions[4][7] = true;
+//
+// instrucions[5][0] = false; instrucions[5][1] = false;
+// instrucions[5][2] = true; instrucions[5][3] = false;
+// instrucions[5][4] = true; instrucions[5][5] = false;
+// instrucions[5][6] = false; instrucions[5][7] = false;
+//
+// instrucions[6][0] = false; instrucions[6][1] = false;
+// instrucions[6][2] = false; instrucions[6][3] = false;
+// instrucions[6][4] = false; instrucions[6][5] = false;
+// instrucions[6][6] = false; instrucions[6][7] = false;
+//
+// instrucions[7][0] = false; instrucions[7][1] = false;
+// instrucions[7][2] = false; instrucions[7][3] = false;
+// instrucions[7][4] = false; instrucions[7][5] = false;
+// instrucions[7][6] = false; instrucions[7][7] = false;
+
+
+
+
+// instrucions[0][0] = true; instrucions[0][1] = false;
+// instrucions[0][2] = false; instrucions[0][3] = false;
+// instrucions[0][4] = true; instrucions[0][5] = true;
+//
+// instrucions[0][6] = false; instrucions[0][7] = true;
+// instrucions[0][8] = false; instrucions[0][9] = false;
+// instrucions[0][10] = true;
+//
+// instrucions[0][11] = false; instrucions[0][12] = true;
+// instrucions[0][13] = false; instrucions[0][14] = false;
+// instrucions[0][15] = false;
+//
+// for(int i=16 ; i<32 ; i++)
+// instrucions[0][i] = false;
+
+
+
+ instructionMemory.setMemory(instrucions);
+ // end of creation
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting gates and wrappers together
+
+
+ // Connecting PCUpdate
+ pcUpdate.addInput(clock.getOutput(0));// add clock for pc
+ pcUpdate.addInput(startAddress);// add start address for fetch instruction
+ for (int i = 16 ; i < 32 ; i++) {// add branch offset
+ pcUpdate.addInput(instructionMemory.getOutput(i));
+ }
+ for (int i = 6; i < 32 ; i++)// add jump address
+ pcUpdate.addInput(instructionMemory.getOutput(i));
+
+ pcUpdate.addInput(alu.getOutput(0));// add zero flag
+ pcUpdate.addInput(controlUnit.getOutput(6));// add branch flag
+ pcUpdate.addInput(controlUnit.getOutput(7));// add jump flag
+
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting instruction memory
+ instructionMemory.addInput(Simulator.falseLogic);
+
+// for(int i = 16 ; i < 32 ; i++)// add don't care data
+// instructionMemory.addInput(Simulator.falseLogic);
+
+ for(int i = 16 ; i < 32 ; i++)// add address to fetch instruction
+ instructionMemory.addInput(pcUpdate.getOutput(i));
+
+// for(int i = 0 ; i < 32 ; i++)// add address to fetch instruction
+// instructionMemory.addInput(Simulator.falseLogic);
+
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting control unit
+ for (int i = 0 ; i < 6 ; i++){// add opcode to control unit
+ controlUnit.addInput(instructionMemory.getOutput(i));
+ }
+
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting register file input
+ for (int i = 0 ; i < 5 ; i++) { // register file mux inputs
+ registerFileInput[i].addInput(controlUnit.getOutput(0));// selector(RegDest)
+ registerFileInput[i].addInput(instructionMemory.getOutput(11+i),instructionMemory.getOutput(16+i));// rs,rt
+ }
+
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting register file
+ registerFile.addInput(clock.getOutput(0));// add clock
+ registerFile.addInput(controlUnit.getOutput(3));
+ for (int i = 0 ; i < 5 ; i++) { // register file write register
+ registerFile.addInput(registerFileInput[i].getOutput(0));
+ }
+ for (int i = 0 ; i < 5 ; i++) { // register file first read register
+ registerFile.addInput(instructionMemory.getOutput(6+i));
+ }
+ for (int i = 0 ; i < 5 ; i++) { // register file second read register
+ registerFile.addInput(instructionMemory.getOutput(11+i));
+ }
+
+ for (int i = 0 ; i < 32 ; i++){// write register data
+ registerFile.addInput(writeRegisterDataSelect[i].getOutput(0));
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting alu control
+ aluControl.addInput(controlUnit.getOutput(8),controlUnit.getOutput(9));// add aluOp
+ for (int i = 0 ; i < 6 ; i++) // add funct
+ aluControl.addInput(instructionMemory.getOutput(26+i));
+
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting signExtend for immediate input
+ for (int i = 16 ; i < 32 ; i++) {// add branch offset
+ immediate.addInput(instructionMemory.getOutput(i));
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting alu second input mux
+ for (int i = 0 ; i < 32 ; i++){// add alu input
+ aluInput[i].addInput(controlUnit.getOutput(1));// selector(AluSrc)
+ aluInput[i].addInput(registerFile.getOutput(32+i),immediate.getOutput(i));// from register or immediate
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting alu
+ for (int i = 0 ; i < 4 ; i++) // add aluControl to alu
+ alu.addInput(aluControl.getOutput(i));
+
+ for (int i = 0 ; i < 32 ; i++){// add first input from register file
+ alu.addInput(registerFile.getInput(i));
+ }
+
+ for (int i = 0 ; i < 32 ; i++){// add second input form mux
+ alu.addInput(aluInput[i].getOutput(0));
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting data memory
+ dataMemory.addInput(controlUnit.getOutput(5));// write flag
+ for (int i = 17 ; i < 33 ; i++){// add address
+ dataMemory.addInput(alu.getOutput(i));
+ }
+ for (int i = 0 ; i < 32 ; i++){// add write data
+ dataMemory.addInput(registerFile.getOutput(32+i));
+ }
+
+ //--------------------------------------------------------------------------------------------------------------
+ // Connecting write back mux
+ for (int i = 0 ; i < 32 ; i++) {
+ writeRegisterData[i].addInput(controlUnit.getOutput(2));// selector(MemToReg)
+ writeRegisterData[i].addInput(alu.getOutput(i+1), dataMemory.getOutput(i)); // inputs
+ }
+
+
+ //--------------------------------------------------------------------------------------------------------------
+
+
+
+
+
+ Simulator.debugger.addTrackItem(clock,dataMemory,registerFile,alu,instructionMemory,
+ pcUpdate,controlUnit);
+
+ Simulator.debugger.setDelay(500);
+ Simulator.circuit.startCircuit();
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/Sample.java b/src/simulator/Sample.java
index 39b3e18..3d05c5b 100644
--- a/src/simulator/Sample.java
+++ b/src/simulator/Sample.java
@@ -3,17 +3,24 @@
package simulator;
import simulator.control.Simulator;
+import simulator.gates.combinational.ByteMemory;
+import simulator.gates.combinational.Memory;
+import simulator.gates.sequential.Clock;
+import simulator.network.Link;
import simulator.wrapper.wrappers.*;
public class Sample {
public static void main(String[] args) {
- //sample circuit
- Adder adder = new Adder("ADDER", "10X6",
- Simulator.falseLogic, Simulator.trueLogic, Simulator.trueLogic, Simulator.falseLogic, Simulator.trueLogic,
- Simulator.falseLogic, Simulator.trueLogic, Simulator.falseLogic, Simulator.falseLogic, Simulator.trueLogic);
+ ByteMemory m = new ByteMemory("t");
+ m.addInput(Simulator.trueLogic);
+ for(int i=0 ;i<16;i++ )
+ m.addInput(Simulator.falseLogic);
+ for(int i=0 ;i<32;i++ )
+ m.addInput(Simulator.trueLogic);
- Simulator.debugger.addTrackItem(adder);
- Simulator.debugger.setDelay(2000);
+ Simulator.debugger.addTrackItem(m);
+ Simulator.debugger.setDelay(500);
Simulator.circuit.startCircuit();
}
-}
\ No newline at end of file
+}
+
diff --git a/src/simulator/control/Circuit.java b/src/simulator/control/Circuit.java
index ff923fb..89290eb 100644
--- a/src/simulator/control/Circuit.java
+++ b/src/simulator/control/Circuit.java
@@ -38,20 +38,6 @@ public void addNode(Node node) {
}
}
- public void startCircuit(String mode) {
- removeDataStream();
- removeLoop();
- if (mode.toLowerCase().equals("real")) {
- realModeInitializeNetList();
- } else {
- initializeNetList();
- }
- addLoop();
- startClocks();
- Simulator.debugger.startDebugger();
- thread.start();
- }
-
public void startCircuit() {
removeDataStream();
removeLoop();
@@ -111,39 +97,6 @@ private void addLoop() {
}
}
-// private Boolean depthFirstSearch(Node node) {
-// boolean loopDetected;
-//
-// if (!node.getLoop())
-// return false;
-//
-// node.setVisited(true);
-//
-// for (Link link: node.getOutputs()) {
-// for (int i = 0; i < link.getDestinations().size(); ++i) {
-// if (link.getDestinations().get(i).isVisited()) {
-// if (!removed.containsKey(link)) {
-// removed.put(link, new ArrayList<>());
-// }
-// removed.get(link).add(link.getDestinations().get(i));
-// link.getDestinations().get(i).getInputs().remove(link);
-// link.getDestinations().remove(i);
-// node.setVisited(false);
-// return true;
-// }
-// loopDetected = depthFirstSearch(link.getDestinations().get(i));
-// if (loopDetected) {
-// node.setVisited(false);
-// return true;
-// }
-// }
-// }
-//
-// node.setLoop(false);
-// node.setVisited(false);
-// return false;
-// }
-
private Boolean depthFirstSearch(Node node) {
Stack stack = new Stack<>();
stack.push(new StackFrame(node));
@@ -235,7 +188,7 @@ private void initializeLevel(int level) {
}
}
- if (flag) {
+ if (flag || innerNode.getLatch()) {
if (netList.size() < level + 2) {
netList.add(new ArrayList<>());
}
@@ -249,29 +202,6 @@ private void initializeLevel(int level) {
}
}
- private void realModeInitializeNetList() {
- int level = 0;
- while (netList.size() >= level + 1) {
- realModeInitializeLevel(level++);
- }
- }
-
- private void realModeInitializeLevel(int level) {
- for (Node node: netList.get(level)) {
- for (Link link: node.getOutputs()) {
- for (Node innerNode : link.getDestinations()) {
- if (netList.size() < level + 2) {
- netList.add(new ArrayList<>());
- }
-
- if (!netList.get(level + 1).contains(innerNode)) {
- netList.get(level + 1).add(innerNode);
- }
- }
- }
- }
- }
-
private void evaluateNetList() {
for (List list: netList) {
for (Node node : list) {
@@ -288,3 +218,59 @@ public void run() {
}
}
}
+
+// private void realModeInitializeNetList() {
+// int level = 0;
+// while (netList.size() >= level + 1) {
+// realModeInitializeLevel(level++);
+// }
+// }
+//
+// private void realModeInitializeLevel(int level) {
+// for (Node node: netList.get(level)) {
+// for (Link link: node.getOutputs()) {
+// for (Node innerNode : link.getDestinations()) {
+// if (netList.size() < level + 2) {
+// netList.add(new ArrayList<>());
+// }
+//
+// if (!netList.get(level + 1).contains(innerNode)) {
+// netList.get(level + 1).add(innerNode);
+// }
+// }
+// }
+// }
+// }
+
+// private Boolean depthFirstSearch(Node node) {
+// boolean loopDetected;
+//
+// if (!node.getLoop())
+// return false;
+//
+// node.setVisited(true);
+//
+// for (Link link: node.getOutputs()) {
+// for (int i = 0; i < link.getDestinations().size(); ++i) {
+// if (link.getDestinations().get(i).isVisited()) {
+// if (!removed.containsKey(link)) {
+// removed.put(link, new ArrayList<>());
+// }
+// removed.get(link).add(link.getDestinations().get(i));
+// link.getDestinations().get(i).getInputs().remove(link);
+// link.getDestinations().remove(i);
+// node.setVisited(false);
+// return true;
+// }
+// loopDetected = depthFirstSearch(link.getDestinations().get(i));
+// if (loopDetected) {
+// node.setVisited(false);
+// return true;
+// }
+// }
+// }
+//
+// node.setLoop(false);
+// node.setVisited(false);
+// return false;
+// }
\ No newline at end of file
diff --git a/src/simulator/gates/combinational/ByteMemory.java b/src/simulator/gates/combinational/ByteMemory.java
new file mode 100644
index 0000000..efea0c1
--- /dev/null
+++ b/src/simulator/gates/combinational/ByteMemory.java
@@ -0,0 +1,75 @@
+package simulator.gates.combinational;
+
+import simulator.network.Link;
+import simulator.network.Node;
+
+/* a byte-addressable memory with 4byte-word with 16bit address bus
+ * in:
+ * 0 : write signal
+ * 1 -> 16: address
+ * 17 -> 48: data in
+ * out:
+ * 0 -> 31 : data out */
+public class ByteMemory extends Node {
+ private Boolean [][] memory;
+
+ public ByteMemory(String label, Link... links) {
+ super(label, links);
+ memory = new Boolean[65536][8];
+ for (int i = 0; i < 32; ++i) {
+ addOutputLink(false);
+ }
+ }
+
+ private int address() {
+ int temp = 0;
+ for (int i = 1; i < 17; ++i) {
+ if(inputs.size() > i) {
+ if(getInput(i).getSignal()) {
+ temp += Math.pow(2, 16 - i);
+ }
+ }
+ }
+
+ return temp;
+ }
+
+ private void memoryWrite() {
+ int address = address();
+
+ for (int i = 0; i < 4; ++i) {
+ if (address + i <= 65535) {
+ for (int j = 0; j < 8; ++j) {
+ memory[address + i][j] = getInput(i * 8 + j + 17).getSignal();
+ }
+ }
+ }
+ }
+
+ private void memoryRead(){
+ int address = address();
+
+ for (int i = 0; i < 4; ++i) {
+ if (address + i <= 65535) {
+ for (int j = 0; j < 8; ++j) {
+ getOutput(i * 8 + j).setSignal(memory[address + i][j]);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void evaluate() {
+ if (getInput(0).getSignal())
+ memoryWrite();
+ memoryRead();
+ }
+
+ public void setMemory(Boolean[][] memory) {
+ this.memory = memory;
+ }
+
+ public Boolean[][] getMemory() {
+ return memory;
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/network/Node.java b/src/simulator/network/Node.java
index 644557e..fee8ce3 100644
--- a/src/simulator/network/Node.java
+++ b/src/simulator/network/Node.java
@@ -15,6 +15,7 @@ public abstract class Node implements Linkable{
protected String label;
protected Boolean visited;
protected Boolean loop;
+ protected Boolean latch;
public Node(String label, Link... links) {
id = nextID++;
@@ -22,6 +23,7 @@ public Node(String label, Link... links) {
outputs = new ArrayList<>();
visited = false;
loop = true;
+ latch = false;
this.label = label;
addInput(links);
@@ -31,7 +33,7 @@ public Node(String label, Link... links) {
public abstract void evaluate();
- public void addOutputLink(Boolean value) {
+ public void addOutputLink(boolean value) {
Link link = new Link(value);
link.setSource(this);
addOutput(link);
@@ -50,8 +52,8 @@ public Link getInput(int index) {
@Override
public void addInput(Link... links) {
for (Link link: links) {
- link.addDestination(this);
- getInputs().add(link);
+ link.addDestination(this);
+ getInputs().add(link);
}
}
@@ -107,6 +109,14 @@ public void setLoop(Boolean loop) {
this.loop = loop;
}
+ public Boolean getLatch() {
+ return latch;
+ }
+
+ public void setLatch(Boolean latch) {
+ this.latch = latch;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
diff --git a/src/simulator/wrapper/wrappers/ALU.java b/src/simulator/wrapper/wrappers/ALU.java
new file mode 100644
index 0000000..4d7a788
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/ALU.java
@@ -0,0 +1,347 @@
+package simulator.wrapper.wrappers;
+
+import simulator.control.Simulator;
+import simulator.gates.combinational.And;
+import simulator.gates.combinational.Not;
+import simulator.gates.combinational.Or;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class ALU extends Wrapper {
+ public ALU (String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+ @Override
+ //I considered the first four inputs as inputs Alu Contorl
+ //The next 32 bits, ie from index 4 to 35, are the input of the first register
+ //The next 32 bits, ie from index 36 to 67, are the input of the second register
+ //Input and output is a link...
+ // index 0 of output is Ziro
+
+ public void initialize() {
+ Not nota = new Not("nota");
+ Not notb = new Not("notb");
+ Not notc = new Not("notc");
+ Not notd = new Not("notd");
+ nota.addInput(getInput(0));
+ notb.addInput(getInput(1));
+ notc.addInput(getInput(2));
+ notd.addInput(getInput(3));
+
+ And CAdd= new And("C-add");
+ And CSub= new And("C-sub");
+ And CAnd= new And("C-and");
+ And COr= new And("C-or");
+ And CSlt= new And("C-slt");
+
+ CAdd.addInput(nota.getOutput(0),notb.getOutput(0),getInput(2),notd.getOutput(0));
+ CSub.addInput(nota.getOutput(0),getInput(1),getInput(2),notd.getOutput(0));
+ CAnd.addInput(nota.getOutput(0),notb.getOutput(0),notc.getOutput(0),notd.getOutput(0));
+ COr.addInput(nota.getOutput(0),notb.getOutput(0),notc.getOutput(0),getInput(3));
+ CSlt.addInput(nota.getOutput(0),getInput(1),getInput(2),getInput(3));
+
+ Adder adder=new Adder("adder","64X33",
+ getInput(4),getInput(5),getInput(6),getInput(7),getInput(8),getInput(9),getInput(10),
+ getInput(11),getInput(12),getInput(13),getInput(14),getInput(15),getInput(16),getInput(17),
+ getInput(18),getInput(19),getInput(20),getInput(21),getInput(22),getInput(23),getInput(24),
+ getInput(25),getInput(26),getInput(27),getInput(28),getInput(29),getInput(30),getInput(31),
+ getInput(32),getInput(33),getInput(34),getInput(35),getInput(36),getInput(37),getInput(38),
+ getInput(39),getInput(40),getInput(41),getInput(42),getInput(43),getInput(44),getInput(45),
+ getInput(46),getInput(47),getInput(48),getInput(49),getInput(50),getInput(51),getInput(52),
+ getInput(53),getInput(54),getInput(55),getInput(56),getInput(57),getInput(58),getInput(59),
+ getInput(60),getInput(61),getInput(62),getInput(63),getInput(64),getInput(65),getInput(66)
+ ,getInput(67));
+ And carry=new And("carry",adder.getOutput(0),Simulator.trueLogic);
+
+ Link[] inp = new Link[32];
+ int i=36;
+ for (int j=0; j<32 ; j++){
+ inp[j] = getInput(i) ;
+ i++;
+ }
+
+ TwosComplement tws =new TwosComplement("tws","32X32",inp);
+
+ Adder sub =new Adder("sub","64X33", getInput(4),getInput(5),getInput(6),getInput(7),getInput(8),getInput(9),getInput(10),
+ getInput(11),getInput(12),getInput(13),getInput(14),getInput(15),getInput(16),getInput(17),
+ getInput(18),getInput(19),getInput(20),getInput(21),getInput(22),getInput(23),getInput(24),
+ getInput(25),getInput(26),getInput(27),getInput(28),getInput(29),getInput(30),getInput(31),
+ getInput(32),getInput(33),getInput(34),getInput(35),
+ tws.getOutput(0),tws.getOutput(1),tws.getOutput(2),tws.getOutput(3),tws.getOutput(4),tws.getOutput(5),
+ tws.getOutput(6),tws.getOutput(7),tws.getOutput(8),tws.getOutput(9),tws.getOutput(10),tws.getOutput(11),
+ tws.getOutput(12),tws.getOutput(13),tws.getOutput(14),tws.getOutput(15),tws.getOutput(16),tws.getOutput(17),
+ tws.getOutput(18),tws.getOutput(19),tws.getOutput(20),tws.getOutput(21),tws.getOutput(22),tws.getOutput(23),
+ tws.getOutput(24),tws.getOutput(25),tws.getOutput(26),tws.getOutput(27),tws.getOutput(28),tws.getOutput(29),
+ tws.getOutput(30),tws.getOutput(31)
+ );
+
+ And and0= new And("and0",getInput(4),getInput(36),CAnd.getOutput(0));
+ And and1= new And("and1",getInput(5),getInput(37),CAnd.getOutput(0));
+ And and2= new And("and2",getInput(6),getInput(38),CAnd.getOutput(0));
+ And and3= new And("and3",getInput(7),getInput(39),CAnd.getOutput(0));
+ And and4= new And("and4",getInput(8),getInput(40),CAnd.getOutput(0));
+ And and5= new And("and6",getInput(9),getInput(41),CAnd.getOutput(0));
+ And and6= new And("and7",getInput(10),getInput(42),CAnd.getOutput(0));
+ And and7= new And("and8",getInput(11),getInput(43),CAnd.getOutput(0));
+ And and8= new And("and9",getInput(12),getInput(44),CAnd.getOutput(0));
+ And and9= new And("and10",getInput(13),getInput(45),CAnd.getOutput(0));
+ And and10= new And("and11",getInput(14),getInput(46),CAnd.getOutput(0));
+ And and11= new And("and12",getInput(15),getInput(47),CAnd.getOutput(0));
+ And and12= new And("and13",getInput(16),getInput(48),CAnd.getOutput(0));
+ And and13= new And("and14",getInput(17),getInput(49),CAnd.getOutput(0));
+ And and14= new And("and15",getInput(18),getInput(50),CAnd.getOutput(0));
+ And and15= new And("and16",getInput(19),getInput(51),CAnd.getOutput(0));
+ And and16= new And("and17",getInput(20),getInput(52),CAnd.getOutput(0));
+ And and17= new And("and18",getInput(21),getInput(53),CAnd.getOutput(0));
+ And and18= new And("and19",getInput(22),getInput(54),CAnd.getOutput(0));
+ And and19= new And("and20",getInput(23),getInput(55),CAnd.getOutput(0));
+ And and20= new And("and21",getInput(24),getInput(56),CAnd.getOutput(0));
+ And and21= new And("and22",getInput(25),getInput(57),CAnd.getOutput(0));
+ And and22= new And("and23",getInput(26),getInput(58),CAnd.getOutput(0));
+ And and23= new And("and24",getInput(27),getInput(59),CAnd.getOutput(0));
+ And and24= new And("and25",getInput(28),getInput(60),CAnd.getOutput(0));
+ And and25= new And("and26",getInput(29),getInput(61),CAnd.getOutput(0));
+ And and26= new And("and26",getInput(30),getInput(62),CAnd.getOutput(0));
+ And and27= new And("and27",getInput(31),getInput(63),CAnd.getOutput(0));
+ And and28= new And("and28",getInput(32),getInput(64),CAnd.getOutput(0));
+ And and29= new And("and29",getInput(33),getInput(65),CAnd.getOutput(0));
+ And and30= new And("and30",getInput(34),getInput(66),CAnd.getOutput(0));
+ And and31= new And("and31",getInput(35),getInput(67),CAnd.getOutput(0));
+
+ Or or0= new Or("and0",getInput(4),getInput(36));
+ Or or1= new Or("and1",getInput(5),getInput(37));
+ Or or2= new Or("and2",getInput(6),getInput(38));
+ Or or3= new Or("and3",getInput(7),getInput(39));
+ Or or4= new Or("and4",getInput(8),getInput(40));
+ Or or5= new Or("and6",getInput(9),getInput(41));
+ Or or6= new Or("and7",getInput(10),getInput(42));
+ Or or7= new Or("and8",getInput(11),getInput(43));
+ Or or8= new Or("and9",getInput(12),getInput(44));
+ Or or9= new Or("and10",getInput(13),getInput(45));
+ Or or10= new Or("and11",getInput(14),getInput(46));
+ Or or11= new Or("and12",getInput(15),getInput(47));
+ Or or12= new Or("and13",getInput(16),getInput(48));
+ Or or13= new Or("and14",getInput(17),getInput(49));
+ Or or14= new Or("and15",getInput(18),getInput(50));
+ Or or15= new Or("and16",getInput(19),getInput(51));
+ Or or16= new Or("and17",getInput(20),getInput(52));
+ Or or17= new Or("and18",getInput(21),getInput(53));
+ Or or18= new Or("and19",getInput(22),getInput(54));
+ Or or19= new Or("and20",getInput(23),getInput(55));
+ Or or20= new Or("and21",getInput(24),getInput(56));
+ Or or21= new Or("and22",getInput(25),getInput(57));
+ Or or22= new Or("and23",getInput(26),getInput(58));
+ Or or23= new Or("and24",getInput(27),getInput(59));
+ Or or24= new Or("and25",getInput(28),getInput(60));
+ Or or25= new Or("and26",getInput(29),getInput(61));
+ Or or26= new Or("and26",getInput(30),getInput(62));
+ Or or27= new Or("and27",getInput(31),getInput(63));
+ Or or28= new Or("and28",getInput(32),getInput(64));
+ Or or29= new Or("and29",getInput(33),getInput(65));
+ Or or30= new Or("and30",getInput(34),getInput(66));
+ Or or31= new Or("and31",getInput(35),getInput(67));
+
+ And Add1 =new And("radd1",adder.getOutput(1),CAdd.getOutput(0));
+ And Add2 =new And("radd2",adder.getOutput(2),CAdd.getOutput(0));
+ And Add3 =new And("radd3",adder.getOutput(3),CAdd.getOutput(0));
+ And Add4 =new And("radd4",adder.getOutput(4),CAdd.getOutput(0));
+ And Add5 =new And("radd5",adder.getOutput(5),CAdd.getOutput(0));
+ And Add6 =new And("radd6",adder.getOutput(6),CAdd.getOutput(0));
+ And Add7 =new And("radd7",adder.getOutput(7),CAdd.getOutput(0));
+ And Add8 =new And("radd8",adder.getOutput(8),CAdd.getOutput(0));
+ And Add9 =new And("radd9",adder.getOutput(9),CAdd.getOutput(0));
+ And Add10 =new And("radd10",adder.getOutput(10),CAdd.getOutput(0));
+ And Add11 =new And("radd11",adder.getOutput(11),CAdd.getOutput(0));
+ And Add12 =new And("radd12",adder.getOutput(12),CAdd.getOutput(0));
+ And Add13 =new And("radd13",adder.getOutput(13),CAdd.getOutput(0));
+ And Add14 =new And("radd14",adder.getOutput(14),CAdd.getOutput(0));
+ And Add15 =new And("radd15",adder.getOutput(15),CAdd.getOutput(0));
+ And Add16 =new And("radd16",adder.getOutput(16),CAdd.getOutput(0));
+ And Add17 =new And("radd17",adder.getOutput(17),CAdd.getOutput(0));
+ And Add18 =new And("radd18",adder.getOutput(18),CAdd.getOutput(0));
+ And Add19 =new And("radd19",adder.getOutput(19),CAdd.getOutput(0));
+ And Add20 =new And("radd20",adder.getOutput(20),CAdd.getOutput(0));
+ And Add21 =new And("radd21",adder.getOutput(21),CAdd.getOutput(0));
+ And Add22 =new And("radd22",adder.getOutput(22),CAdd.getOutput(0));
+ And Add23 =new And("radd23",adder.getOutput(23),CAdd.getOutput(0));
+ And Add24 =new And("radd24",adder.getOutput(24),CAdd.getOutput(0));
+ And Add25 =new And("radd25",adder.getOutput(25),CAdd.getOutput(0));
+ And Add26 =new And("radd26",adder.getOutput(26),CAdd.getOutput(0));
+ And Add27 =new And("radd27",adder.getOutput(27),CAdd.getOutput(0));
+ And Add28 =new And("radd28",adder.getOutput(28),CAdd.getOutput(0));
+ And Add29 =new And("radd29",adder.getOutput(29),CAdd.getOutput(0));
+ And Add30 =new And("radd30",adder.getOutput(30),CAdd.getOutput(0));
+ And Add31 =new And("radd31",adder.getOutput(31),CAdd.getOutput(0));
+ And Add32 =new And("radd32",adder.getOutput(32),CAdd.getOutput(0));
+
+
+ And Sub1 =new And("sub0",CSub.getOutput(0),sub.getOutput(1));
+ And Sub2 =new And("sub1",CSub.getOutput(0),sub.getOutput(2));
+ And Sub3 =new And("sub2",CSub.getOutput(0),sub.getOutput(3));
+ And Sub4 =new And("sub3",CSub.getOutput(0),sub.getOutput(4));
+ And Sub5 =new And("sub4",CSub.getOutput(0),sub.getOutput(5));
+ And Sub6 =new And("sub5",CSub.getOutput(0),sub.getOutput(6));
+ And Sub7 =new And("sub6",CSub.getOutput(0),sub.getOutput(7));
+ And Sub8 =new And("sub7",CSub.getOutput(0),sub.getOutput(8));
+ And Sub9 =new And("sub8",CSub.getOutput(0),sub.getOutput(9));
+ And Sub10 =new And("sub9",CSub.getOutput(0),sub.getOutput(10));
+ And Sub11 =new And("sub10",CSub.getOutput(0),sub.getOutput(11));
+ And Sub12 =new And("sub11",CSub.getOutput(0),sub.getOutput(12));
+ And Sub13 =new And("sub12",CSub.getOutput(0),sub.getOutput(13));
+ And Sub14 =new And("sub13",CSub.getOutput(0),sub.getOutput(14));
+ And Sub15 =new And("sub14",CSub.getOutput(0),sub.getOutput(15));
+ And Sub16 =new And("sub15",CSub.getOutput(0),sub.getOutput(16));
+ And Sub17 =new And("sub16",CSub.getOutput(0),sub.getOutput(17));
+ And Sub18 =new And("sub17",CSub.getOutput(0),sub.getOutput(18));
+ And Sub19 =new And("sub18",CSub.getOutput(0),sub.getOutput(19));
+ And Sub20 =new And("sub19",CSub.getOutput(0),sub.getOutput(20));
+ And Sub21 =new And("sub20",CSub.getOutput(0),sub.getOutput(21));
+ And Sub22 =new And("sub21",CSub.getOutput(0),sub.getOutput(22));
+ And Sub23 =new And("sub22",CSub.getOutput(0),sub.getOutput(23));
+ And Sub24 =new And("sub23",CSub.getOutput(0),sub.getOutput(24));
+ And Sub25 =new And("sub24",CSub.getOutput(0),sub.getOutput(25));
+ And Sub26 =new And("sub25",CSub.getOutput(0),sub.getOutput(26));
+ And Sub27 =new And("sub26",CSub.getOutput(0),sub.getOutput(27));
+ And Sub28 =new And("sub27",CSub.getOutput(0),sub.getOutput(28));
+ And Sub29 =new And("sub28",CSub.getOutput(0),sub.getOutput(29));
+ And Sub30 =new And("sub29",CSub.getOutput(0),sub.getOutput(30));
+ And Sub31 =new And("sub30",CSub.getOutput(0),sub.getOutput(31));
+ And Sub32 =new And("sub31",CSub.getOutput(0),sub.getOutput(32));
+
+ And Or1= new And("or0",COr.getOutput(0),or0.getOutput(0));
+ And Or2= new And("or1",COr.getOutput(0),or1.getOutput(0));
+ And Or3= new And("or2",COr.getOutput(0),or2.getOutput(0));
+ And Or4= new And("or3",COr.getOutput(0),or3.getOutput(0));
+ And Or5= new And("or4",COr.getOutput(0),or4.getOutput(0));
+ And Or6= new And("or5",COr.getOutput(0),or5.getOutput(0));
+ And Or7= new And("or6",COr.getOutput(0),or6.getOutput(0));
+ And Or8= new And("or7",COr.getOutput(0),or7.getOutput(0));
+ And Or9= new And("or8",COr.getOutput(0),or8.getOutput(0));
+ And Or10= new And("or9",COr.getOutput(0),or9.getOutput(0));
+ And Or11= new And("or10",COr.getOutput(0),or10.getOutput(0));
+ And Or12= new And("or11",COr.getOutput(0),or11.getOutput(0));
+ And Or13= new And("or12",COr.getOutput(0),or12.getOutput(0));
+ And Or14= new And("or13",COr.getOutput(0),or13.getOutput(0));
+ And Or15= new And("or14",COr.getOutput(0),or14.getOutput(0));
+ And Or16= new And("or15",COr.getOutput(0),or15.getOutput(0));
+ And Or17= new And("or16",COr.getOutput(0),or16.getOutput(0));
+ And Or18= new And("or17",COr.getOutput(0),or17.getOutput(0));
+ And Or19= new And("or18",COr.getOutput(0),or18.getOutput(0));
+ And Or20= new And("or19",COr.getOutput(0),or19.getOutput(0));
+ And Or21= new And("or20",COr.getOutput(0),or20.getOutput(0));
+ And Or22= new And("or21",COr.getOutput(0),or21.getOutput(0));
+ And Or23= new And("or22",COr.getOutput(0),or22.getOutput(0));
+ And Or24= new And("or23",COr.getOutput(0),or23.getOutput(0));
+ And Or25= new And("or24",COr.getOutput(0),or24.getOutput(0));
+ And Or26= new And("or25",COr.getOutput(0),or25.getOutput(0));
+ And Or27= new And("or26",COr.getOutput(0),or26.getOutput(0));
+ And Or28= new And("or27",COr.getOutput(0),or27.getOutput(0));
+ And Or29= new And("or28",COr.getOutput(0),or28.getOutput(0));
+ And Or30= new And("or29",COr.getOutput(0),or29.getOutput(0));
+ And Or31= new And("or30",COr.getOutput(0),or30.getOutput(0));
+ And Or32= new And("or31",COr.getOutput(0),or31.getOutput(0));
+
+ Not notx0=new Not("notx0"
+ ,
+ getInput(4),getInput(5),getInput(6),getInput(7),getInput(8),getInput(9),getInput(10),
+ getInput(11),getInput(12),getInput(13),getInput(14),getInput(15),getInput(16),getInput(17),
+ getInput(18),getInput(19),getInput(20),getInput(21),getInput(22),getInput(23),getInput(24),
+ getInput(25),getInput(26),getInput(27),getInput(28),getInput(29),getInput(30),getInput(31),
+ getInput(32),getInput(33),getInput(34),getInput(35));
+
+ And slt1=new And("slt1",notx0.getOutput(0),getInput(36));
+ And slt2=new And("slt2",notx0.getOutput(1),getInput(37));
+ And slt3=new And("slt3",notx0.getOutput(2),getInput(38));
+ And slt4=new And("slt4",notx0.getOutput(3),getInput(39));
+ And slt5=new And("slt5",notx0.getOutput(4),getInput(40));
+ And slt6=new And("slt6",notx0.getOutput(5),getInput(41));
+ And slt7=new And("slt7",notx0.getOutput(6),getInput(42));
+ And slt8=new And("slt8",notx0.getOutput(7),getInput(43));
+ And slt9=new And("slt9",notx0.getOutput(8),getInput(44));
+ And slt10=new And("slt10",notx0.getOutput(9),getInput(45));
+ And slt11=new And("slt11",notx0.getOutput(10),getInput(46));
+ And slt12=new And("slt12",notx0.getOutput(11),getInput(47));
+ And slt13=new And("slt13",notx0.getOutput(12),getInput(48));
+ And slt14=new And("slt14",notx0.getOutput(13),getInput(49));
+ And slt15=new And("slt15",notx0.getOutput(14),getInput(50));
+ And slt16=new And("slt16",notx0.getOutput(15),getInput(51));
+ And slt17=new And("slt17",notx0.getOutput(16),getInput(52));
+ And slt18=new And("slt18",notx0.getOutput(17),getInput(53));
+ And slt19=new And("slt19",notx0.getOutput(18),getInput(54));
+ And slt20=new And("slt20",notx0.getOutput(19),getInput(55));
+ And slt21=new And("slt21",notx0.getOutput(20),getInput(56));
+ And slt22=new And("slt22",notx0.getOutput(21),getInput(57));
+ And slt23=new And("slt23",notx0.getOutput(22),getInput(58));
+ And slt24=new And("slt24",notx0.getOutput(23),getInput(59));
+ And slt25=new And("slt25",notx0.getOutput(24),getInput(60));
+ And slt26=new And("slt26",notx0.getOutput(25),getInput(61));
+ And slt27=new And("slt27",notx0.getOutput(26),getInput(62));
+ And slt28=new And("slt28",notx0.getOutput(27),getInput(63));
+ And slt29=new And("slt29",notx0.getOutput(28),getInput(64));
+ And slt30=new And("slt30",notx0.getOutput(29),getInput(65));
+ And slt31=new And("slt31",notx0.getOutput(30),getInput(66));
+ And slt32=new And("slt32",notx0.getOutput(31),getInput(67));
+
+ Or Sltrez=new Or("Sltrez",
+ slt1.getOutput(0),slt2.getOutput(0),slt3.getOutput(0),slt4.getOutput(0),slt5.getOutput(0),
+ slt6.getOutput(0),slt7.getOutput(0),slt8.getOutput(0),slt9.getOutput(0),slt10.getOutput(0),
+ slt11.getOutput(0),slt12.getOutput(0),slt13.getOutput(0),slt14.getOutput(0),slt15.getOutput(0),
+ slt16.getOutput(0),slt17.getOutput(0),slt18.getOutput(0),slt19.getOutput(0),slt20.getOutput(0),
+ slt21.getOutput(0),slt22.getOutput(0),slt23.getOutput(0),slt24.getOutput(0),slt25.getOutput(0),
+ slt26.getOutput(0),slt27.getOutput(0),slt28.getOutput(0),slt29.getOutput(0),slt30.getOutput(0),
+ slt31.getOutput(0),slt32.getOutput(0));
+ And Sltresult= new And("rezult",CSlt.getOutput(0),Sltrez.getOutput(0));
+
+ Or r1=new Or("r1",Add1.getOutput(0),and0.getOutput(0),Or1.getOutput(0),Sub1.getOutput(0));
+ Or r2=new Or("r2",Add2.getOutput(0),and1.getOutput(0),Or2.getOutput(0),Sub2.getOutput(0));
+ Or r3=new Or("r3",Add3.getOutput(0),and2.getOutput(0),Or3.getOutput(0),Sub3.getOutput(0));
+ Or r4=new Or("r4",Add4.getOutput(0),and3.getOutput(0),Or4.getOutput(0),Sub4.getOutput(0));
+ Or r5=new Or("r5",Add5.getOutput(0),and4.getOutput(0),Or5.getOutput(0),Sub5.getOutput(0));
+ Or r6=new Or("r6",Add6.getOutput(0),and5.getOutput(0),Or6.getOutput(0),Sub6.getOutput(0));
+ Or r7=new Or("r7",Add7.getOutput(0),and6.getOutput(0),Or7.getOutput(0),Sub7.getOutput(0));
+ Or r8=new Or("r8",Add8.getOutput(0),and7.getOutput(0),Or8.getOutput(0),Sub8.getOutput(0));
+ Or r9=new Or("r9",Add9.getOutput(0),and8.getOutput(0),Or9.getOutput(0),Sub9.getOutput(0));
+ Or r10=new Or("r10",Add10.getOutput(0),and9.getOutput(0),Or10.getOutput(0),Sub10.getOutput(0));
+ Or r11=new Or("r11",Add11.getOutput(0),and10.getOutput(0),Or11.getOutput(0),Sub11.getOutput(0));
+ Or r12=new Or("r12",Add12.getOutput(0),and11.getOutput(0),Or12.getOutput(0),Sub12.getOutput(0));
+ Or r13=new Or("r13",Add13.getOutput(0),and12.getOutput(0),Or13.getOutput(0),Sub13.getOutput(0));
+ Or r14=new Or("r14",Add14.getOutput(0),and13.getOutput(0),Or14.getOutput(0),Sub14.getOutput(0));
+ Or r15=new Or("r15",Add15.getOutput(0),and14.getOutput(0),Or15.getOutput(0),Sub15.getOutput(0));
+ Or r16=new Or("r16",Add16.getOutput(0),and15.getOutput(0),Or16.getOutput(0),Sub16.getOutput(0));
+ Or r17=new Or("r17",Add17.getOutput(0),and16.getOutput(0),Or17.getOutput(0),Sub17.getOutput(0));
+ Or r18=new Or("r18",Add18.getOutput(0),and17.getOutput(0),Or18.getOutput(0),Sub18.getOutput(0));
+ Or r19=new Or("r19",Add19.getOutput(0),and18.getOutput(0),Or19.getOutput(0),Sub19.getOutput(0));
+ Or r20=new Or("r20",Add20.getOutput(0),and19.getOutput(0),Or20.getOutput(0),Sub20.getOutput(0));
+ Or r21=new Or("r21",Add21.getOutput(0),and20.getOutput(0),Or21.getOutput(0),Sub21.getOutput(0));
+ Or r22=new Or("r22",Add22.getOutput(0),and21.getOutput(0),Or22.getOutput(0),Sub22.getOutput(0));
+ Or r23=new Or("r23",Add23.getOutput(0),and22.getOutput(0),Or23.getOutput(0),Sub23.getOutput(0));
+ Or r24=new Or("r24",Add24.getOutput(0),and23.getOutput(0),Or24.getOutput(0),Sub24.getOutput(0));
+ Or r25=new Or("r25",Add25.getOutput(0),and24.getOutput(0),Or25.getOutput(0),Sub25.getOutput(0));
+ Or r26=new Or("r26",Add26.getOutput(0),and25.getOutput(0),Or26.getOutput(0),Sub26.getOutput(0));
+ Or r27=new Or("r27",Add27.getOutput(0),and26.getOutput(0),Or27.getOutput(0),Sub27.getOutput(0));
+ Or r28=new Or("r28",Add28.getOutput(0),and27.getOutput(0),Or28.getOutput(0),Sub28.getOutput(0));
+ Or r29=new Or("r29",Add29.getOutput(0),and28.getOutput(0),Or29.getOutput(0),Sub29.getOutput(0));
+ Or r30=new Or("r30",Add30.getOutput(0),and29.getOutput(0),Or30.getOutput(0),Sub30.getOutput(0));
+ Or r31=new Or("r31",Add31.getOutput(0),and30.getOutput(0),Or31.getOutput(0),Sub31.getOutput(0));
+ Or r32=new Or("r32",Add32.getOutput(0),and31.getOutput(0),Or32.getOutput(0),Sub32.getOutput(0),Sltresult.getOutput(0));
+
+
+
+ Or zerot=new Or("orzerot",
+ r1.getOutput(0),r2.getOutput(0),r3.getOutput(0),r4.getOutput(0),r5.getOutput(0),r6.getOutput(0),
+ r7.getOutput(0),r8.getOutput(0),r9.getOutput(0),r10.getOutput(0),r11.getOutput(0),r12.getOutput(0),
+ r13.getOutput(0),r14.getOutput(0),r15.getOutput(0),r16.getOutput(0),r17.getOutput(0),r18.getOutput(0),
+ r19.getOutput(0),r20.getOutput(0),r21.getOutput(0),r22.getOutput(0),r23.getOutput(0),r25.getOutput(0),
+ r26.getOutput(0),r27.getOutput(0),r28.getOutput(0),r29.getOutput(0),r30.getOutput(0),r31.getOutput(0),
+ r32.getOutput(0),r24.getOutput(0));
+ Not zero=new Not("zero",zerot.getOutput(0));
+ addOutput(zero.getOutput(0),r1.getOutput(0),r2.getOutput(0),r3.getOutput(0),r4.getOutput(0),r5.getOutput(0),r6.getOutput(0),
+ r7.getOutput(0),r8.getOutput(0),r9.getOutput(0),r10.getOutput(0),r11.getOutput(0),r12.getOutput(0),
+ r13.getOutput(0),r14.getOutput(0),r15.getOutput(0),r16.getOutput(0),r17.getOutput(0),r18.getOutput(0),
+ r19.getOutput(0),r20.getOutput(0),r21.getOutput(0),r22.getOutput(0),r23.getOutput(0),r24.getOutput(0),
+ r25.getOutput(0), r26.getOutput(0),r27.getOutput(0),r28.getOutput(0),r29.getOutput(0),r30.getOutput(0),
+ r31.getOutput(0),
+ r32.getOutput(0));
+
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/ALUControl.java b/src/simulator/wrapper/wrappers/ALUControl.java
new file mode 100644
index 0000000..266b8f7
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/ALUControl.java
@@ -0,0 +1,145 @@
+package simulator.wrapper.wrappers;
+
+import simulator.control.Simulator;
+import simulator.gates.combinational.And;
+import simulator.gates.combinational.Not;
+import simulator.gates.combinational.Or;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class ALUControl extends Wrapper {
+ public ALUControl(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+ //Input and output is a link...
+ //Se consideran 8 bits de entrada, los primeros dos bits ALUOp 6 bits son funciones
+ //outputs is 4 bits
+ @Override
+ public void initialize() {
+ And CLwSw =new And("lwsw");
+ And Cbeq =new And("beq");
+ And Cadd=new And("add");
+ And Csub=new And("sub");
+ And CAND=new And("AND");
+ And COR=new And("OR");
+ And CSetOnLessThan=new And("slt");
+
+ And LwSw0=new And("s0");
+ And LwSw1=new And("s1");
+ And LwSw2=new And("s2");
+ And LwSw3=new And("s2");
+
+ And beq0=new And("be0");
+ And beq1=new And("be1");
+ And beq2=new And("be2");
+ And beq3=new And("be3");
+
+ And add0=new And("add0");
+ And add1=new And("add1");
+ And add2=new And("add2");
+ And add3=new And("add3");
+
+ And sub0=new And("sub0");
+ And sub1=new And("sub1");
+ And sub2=new And("sub2");
+ And sub3=new And("sub3");
+
+ And and0=new And("and0");
+ And and1=new And("and1");
+ And and2=new And("and2");
+ And and3=new And("and3");
+
+ And or0=new And("or0");
+ And or1=new And("or1");
+ And or2=new And("or2");
+ And or3=new And("or3");
+
+ And slt0=new And("slt0");
+ And slt1=new And("slt1");
+ And slt2=new And("slt2");
+ And slt3=new And("slt3");
+
+ Or r0=new Or("r0");
+ Or r1=new Or("r1");
+ Or r2=new Or("r2");
+ Or r3=new Or("r3");
+
+ Not notA=new Not("notA");
+ notA.addInput(getInput(0));
+ Not notB=new Not("notB");
+ notB.addInput(getInput(1));
+ Not notC=new Not("notC");
+ notC.addInput(getInput(2));
+ Not notD=new Not("notD");
+ notD.addInput(getInput(3));
+ Not notE=new Not("notE");
+ notE.addInput(getInput(4));
+ Not notF=new Not("notF");
+ notF.addInput(getInput(5));
+ Not notG=new Not("notG");
+ notG.addInput(getInput(6));
+ Not notH=new Not("notH");
+ notH.addInput(getInput(7));
+
+ CLwSw.addInput(notA.getOutput(0),notB.getOutput(0));
+ Cbeq.addInput(notA.getOutput(0),getInput(1));
+ Cadd.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),notE.getOutput(0),
+ notF.getOutput(0),notG.getOutput(0),notH.getOutput(0));
+ Csub.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),notE.getOutput(0),
+ notF.getOutput(0),getInput(6),notH.getOutput(0));
+
+ CAND.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),notE.getOutput(0),
+ getInput(5),notG.getOutput(0),notH.getOutput(0));
+ COR.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),notE.getOutput(0),
+ getInput(5),notG.getOutput(0),getInput(7));
+ CSetOnLessThan.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),getInput(4),
+ notF.getOutput(0),getInput(6),notH.getOutput(0));
+
+ LwSw0.addInput(CLwSw.getOutput(0),Simulator.falseLogic);
+ LwSw1.addInput(CLwSw.getOutput(0),Simulator.falseLogic);
+ LwSw2.addInput(CLwSw.getOutput(0),Simulator.trueLogic);
+ LwSw3.addInput(CLwSw.getOutput(0),Simulator.falseLogic);
+
+ beq0.addInput(Cbeq.getOutput(0),Simulator.falseLogic);
+ beq1.addInput(Cbeq.getOutput(0),Simulator.trueLogic);
+ beq2.addInput(Cbeq.getOutput(0),Simulator.trueLogic);
+ beq3.addInput(Cbeq.getOutput(0),Simulator.falseLogic);
+
+ add0.addInput(Cadd.getOutput(0),Simulator.falseLogic);
+ add1.addInput(Cadd.getOutput(0),Simulator.falseLogic);
+ add2.addInput(Cadd.getOutput(0),Simulator.trueLogic);
+ add3.addInput(Cadd.getOutput(0),Simulator.falseLogic);
+
+ sub0.addInput(Csub.getOutput(0),Simulator.falseLogic);
+ sub1.addInput(Csub.getOutput(0),Simulator.trueLogic);
+ sub2.addInput(Csub.getOutput(0),Simulator.trueLogic);
+ sub3.addInput(Csub.getOutput(0),Simulator.falseLogic);
+
+ and0.addInput(CAND.getOutput(0),Simulator.falseLogic);
+ and1.addInput(CAND.getOutput(0),Simulator.falseLogic);
+ and2.addInput(CAND.getOutput(0),Simulator.falseLogic);
+ and3.addInput(CAND.getOutput(0),Simulator.falseLogic);
+
+ or0.addInput(COR.getOutput(0),Simulator.falseLogic);
+ or1.addInput(COR.getOutput(0),Simulator.falseLogic);
+ or2.addInput(COR.getOutput(0),Simulator.falseLogic);
+ or3.addInput(COR.getOutput(0),Simulator.trueLogic);
+
+ slt0.addInput(CSetOnLessThan.getOutput(0),Simulator.falseLogic);
+ slt1.addInput(CSetOnLessThan.getOutput(0),Simulator.trueLogic);
+ slt2.addInput(CSetOnLessThan.getOutput(0),Simulator.trueLogic);
+ slt3.addInput(CSetOnLessThan.getOutput(0),Simulator.trueLogic);
+
+ r0.addInput(LwSw0.getOutput(0),beq0.getOutput(0),add0.getOutput(0),sub0.getOutput(0),
+ and0.getOutput(0),or0.getOutput(0),slt0.getOutput(0));
+ r1.addInput(LwSw1.getOutput(0),beq1.getOutput(0),add1.getOutput(0),sub1.getOutput(0),
+ and1.getOutput(0),or1.getOutput(0),slt1.getOutput(0));
+ r2.addInput(LwSw2.getOutput(0),beq2.getOutput(0),add2.getOutput(0),sub2.getOutput(0),
+ and2.getOutput(0),or2.getOutput(0),slt2.getOutput(0));
+ r3.addInput(LwSw3.getOutput(0),beq3.getOutput(0),add3.getOutput(0),sub3.getOutput(0),
+ and3.getOutput(0),or3.getOutput(0),slt3.getOutput(0));
+
+ addOutput(r0.getOutput(0),r1.getOutput(0),r2.getOutput(0),r3.getOutput(0));
+
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/AluContorl.java b/src/simulator/wrapper/wrappers/AluContorl.java
new file mode 100644
index 0000000..273edf8
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/AluContorl.java
@@ -0,0 +1,145 @@
+package simulator.wrapper.wrappers;
+
+import simulator.control.Simulator;
+import simulator.gates.combinational.And;
+import simulator.gates.combinational.Not;
+import simulator.gates.combinational.Or;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class AluContorl extends Wrapper {
+ public AluContorl(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+ //Input and output is a link...
+ //Se consideran 8 bits de entrada, los primeros dos bits ALUOp 6 bits son funciones
+ //outputs is 4 bits
+ @Override
+ public void initialize() {
+ And CLwSw =new And("lwsw");
+ And Cbeq =new And("beq");
+ And Cadd=new And("add");
+ And Csub=new And("sub");
+ And CAND=new And("AND");
+ And COR=new And("OR");
+ And CSetOnLessThan=new And("slt");
+
+ And LwSw0=new And("s0");
+ And LwSw1=new And("s1");
+ And LwSw2=new And("s2");
+ And LwSw3=new And("s2");
+
+ And beq0=new And("be0");
+ And beq1=new And("be1");
+ And beq2=new And("be2");
+ And beq3=new And("be3");
+
+ And add0=new And("add0");
+ And add1=new And("add1");
+ And add2=new And("add2");
+ And add3=new And("add3");
+
+ And sub0=new And("sub0");
+ And sub1=new And("sub1");
+ And sub2=new And("sub2");
+ And sub3=new And("sub3");
+
+ And and0=new And("and0");
+ And and1=new And("and1");
+ And and2=new And("and2");
+ And and3=new And("and3");
+
+ And or0=new And("or0");
+ And or1=new And("or1");
+ And or2=new And("or2");
+ And or3=new And("or3");
+
+ And slt0=new And("slt0");
+ And slt1=new And("slt1");
+ And slt2=new And("slt2");
+ And slt3=new And("slt3");
+
+ Or r0=new Or("r0");
+ Or r1=new Or("r1");
+ Or r2=new Or("r2");
+ Or r3=new Or("r3");
+
+ Not notA=new Not("notA");
+ notA.addInput(getInput(0));
+ Not notB=new Not("notB");
+ notB.addInput(getInput(1));
+ Not notC=new Not("notC");
+ notC.addInput(getInput(2));
+ Not notD=new Not("notD");
+ notD.addInput(getInput(3));
+ Not notE=new Not("notE");
+ notE.addInput(getInput(4));
+ Not notF=new Not("notF");
+ notF.addInput(getInput(5));
+ Not notG=new Not("notG");
+ notG.addInput(getInput(6));
+ Not notH=new Not("notH");
+ notH.addInput(getInput(7));
+
+ CLwSw.addInput(notA.getOutput(0),notB.getOutput(0));
+ Cbeq.addInput(notA.getOutput(0),getInput(1));
+ Cadd.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),notE.getOutput(0),
+ notF.getOutput(0),notG.getOutput(0),notH.getOutput(0));
+ Csub.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),notE.getOutput(0),
+ notF.getOutput(0),getInput(6),notH.getOutput(0));
+
+ CAND.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),notE.getOutput(0),
+ getInput(5),notG.getOutput(0),notH.getOutput(0));
+ COR.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),notE.getOutput(0),
+ getInput(5),notG.getOutput(0),getInput(7));
+ CSetOnLessThan.addInput(getInput(0),notB.getOutput(0),getInput(2),notD.getOutput(0),getInput(4),
+ notF.getOutput(0),getInput(6),notH.getOutput(0));
+
+ LwSw0.addInput(CLwSw.getOutput(0),Simulator.falseLogic);
+ LwSw1.addInput(CLwSw.getOutput(0),Simulator.falseLogic);
+ LwSw2.addInput(CLwSw.getOutput(0),Simulator.trueLogic);
+ LwSw3.addInput(CLwSw.getOutput(0),Simulator.falseLogic);
+
+ beq0.addInput(Cbeq.getOutput(0),Simulator.falseLogic);
+ beq1.addInput(Cbeq.getOutput(0),Simulator.trueLogic);
+ beq2.addInput(Cbeq.getOutput(0),Simulator.trueLogic);
+ beq3.addInput(Cbeq.getOutput(0),Simulator.falseLogic);
+
+ add0.addInput(Cadd.getOutput(0),Simulator.falseLogic);
+ add1.addInput(Cadd.getOutput(0),Simulator.falseLogic);
+ add2.addInput(Cadd.getOutput(0),Simulator.trueLogic);
+ add3.addInput(Cadd.getOutput(0),Simulator.falseLogic);
+
+ sub0.addInput(Csub.getOutput(0),Simulator.falseLogic);
+ sub1.addInput(Csub.getOutput(0),Simulator.trueLogic);
+ sub2.addInput(Csub.getOutput(0),Simulator.trueLogic);
+ sub3.addInput(Csub.getOutput(0),Simulator.falseLogic);
+
+ and0.addInput(CAND.getOutput(0),Simulator.falseLogic);
+ and1.addInput(CAND.getOutput(0),Simulator.falseLogic);
+ and2.addInput(CAND.getOutput(0),Simulator.falseLogic);
+ and3.addInput(CAND.getOutput(0),Simulator.falseLogic);
+
+ or0.addInput(COR.getOutput(0),Simulator.falseLogic);
+ or1.addInput(COR.getOutput(0),Simulator.falseLogic);
+ or2.addInput(COR.getOutput(0),Simulator.falseLogic);
+ or3.addInput(COR.getOutput(0),Simulator.trueLogic);
+
+ slt0.addInput(CSetOnLessThan.getOutput(0),Simulator.falseLogic);
+ slt1.addInput(CSetOnLessThan.getOutput(0),Simulator.trueLogic);
+ slt2.addInput(CSetOnLessThan.getOutput(0),Simulator.trueLogic);
+ slt3.addInput(CSetOnLessThan.getOutput(0),Simulator.trueLogic);
+
+ r0.addInput(LwSw0.getOutput(0),beq0.getOutput(0),add0.getOutput(0),sub0.getOutput(0),
+ and0.getOutput(0),or0.getOutput(0),slt0.getOutput(0));
+ r1.addInput(LwSw1.getOutput(0),beq1.getOutput(0),add1.getOutput(0),sub1.getOutput(0),
+ and1.getOutput(0),or1.getOutput(0),slt1.getOutput(0));
+ r2.addInput(LwSw2.getOutput(0),beq2.getOutput(0),add2.getOutput(0),sub2.getOutput(0),
+ and2.getOutput(0),or2.getOutput(0),slt2.getOutput(0));
+ r3.addInput(LwSw3.getOutput(0),beq3.getOutput(0),add3.getOutput(0),sub3.getOutput(0),
+ and3.getOutput(0),or3.getOutput(0),slt3.getOutput(0));
+
+ addOutput(r0.getOutput(0),r1.getOutput(0),r2.getOutput(0),r3.getOutput(0));
+
+ }
+}
diff --git a/src/simulator/wrapper/wrappers/ControlUnit.java b/src/simulator/wrapper/wrappers/ControlUnit.java
new file mode 100644
index 0000000..751423f
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/ControlUnit.java
@@ -0,0 +1,54 @@
+package simulator.wrapper.wrappers;
+
+import simulator.gates.combinational.And;
+import simulator.gates.combinational.Not;
+import simulator.gates.combinational.Or;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class ControlUnit extends Wrapper {
+
+ public ControlUnit(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+
+ Link op0,op1,op2,op3,op4,op5;
+ op0 = getInput(5);
+ op1 = getInput(4);
+ op2 = getInput(3);
+ op3 = getInput(2);
+ op4 = getInput(1);
+ op5 = getInput(0);
+ Not not0 = new Not("Not0" , op0);
+ Not not1 = new Not("Not1" , op1);
+ Not not2 = new Not("Not2" , op2);
+ Not not3 = new Not("Not3" , op3);
+ Not not4 = new Not("Not4" , op4);
+ Not not5 = new Not("Not5" , op5);
+
+ And R_format = new And("R-format-AND",not0.getOutput(0),not1.getOutput(0),not2.getOutput(0),not3.getOutput(0),not4.getOutput(0),not5.getOutput(0));
+ And lw = new And("Lw-AND",op0,op1,not2.getOutput(0),not3.getOutput(0),not4.getOutput(0),op5);
+ And sw = new And("R-format-AND",op0,op1,not2.getOutput(0),op3,not4.getOutput(0),op5);
+ And beq = new And("R-format-AND",not0.getOutput(0),not1.getOutput(0),op2,not3.getOutput(0),not4.getOutput(0),not5.getOutput(0));
+ And j = new And("Jump-AND",not0.getOutput(0),op1,not2.getOutput(0),not3.getOutput(0),not4.getOutput(0),not5.getOutput(0));
+
+ Or aluSrc = new Or("Or1",lw.getOutput(0),sw.getOutput(0));
+ Or regWrite = new Or("Or1",lw.getOutput(0),R_format.getOutput(0));
+
+ addOutput(R_format.getOutput(0));// RegDst
+ addOutput(aluSrc.getOutput(0));// ALUSrc
+ addOutput(lw.getOutput(0));// MemToReg
+ addOutput(regWrite.getOutput(0));// RegWrite
+ addOutput(lw.getOutput(0));// MemRead
+ addOutput(sw.getOutput(0));// MemWrite
+ addOutput(beq.getOutput(0));// Branch
+ addOutput(j.getOutput(0));// Jump
+ addOutput(R_format.getOutput(0));// ALUOp1
+ addOutput(beq.getOutput(0));// ALUOp2
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/DFlipFlop.java b/src/simulator/wrapper/wrappers/DFlipFlop.java
new file mode 100644
index 0000000..d8d61b8
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/DFlipFlop.java
@@ -0,0 +1,44 @@
+package simulator.wrapper.wrappers;
+
+import simulator.gates.combinational.Nand;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+/*a data flip-flop
+ * in:
+ * 0 : clock signal
+ * 1 : data signal
+ * out:
+ * 0 : q
+ * 1 : q-bar */
+public class DFlipFlop extends Wrapper {
+ public DFlipFlop(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+ Nand n1 = new Nand("NAND1");
+ Nand n2 = new Nand("NAND2");
+ Nand n3 = new Nand("NAND3");
+ Nand n4 = new Nand("NAND4");
+ Nand n5 = new Nand("NAND5");
+ Nand n6 = new Nand("NAND6");
+
+ n1.setLatch(true);
+ n2.setLatch(true);
+ n3.setLatch(true);
+ n4.setLatch(true);
+ n5.setLatch(true);
+ n6.setLatch(true);
+
+ n1.addInput(n4.getOutput(0), n2.getOutput(0));
+ n2.addInput(getInput(0), n1.getOutput(0));
+ n3.addInput(n2.getOutput(0), getInput(0), n4.getOutput(0));
+ n4.addInput(n3.getOutput(0), getInput(1));
+ n5.addInput(n2.getOutput(0), n6.getOutput(0));
+ n6.addInput(n3.getOutput(0), n5.getOutput(0));
+
+ addOutput(n5.getOutput(0), n6.getOutput(0));
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/Decoder3X8.java b/src/simulator/wrapper/wrappers/Decoder3X8.java
new file mode 100644
index 0000000..51b6d92
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/Decoder3X8.java
@@ -0,0 +1,44 @@
+package simulator.wrapper.wrappers;
+
+import simulator.gates.combinational.And;
+import simulator.gates.combinational.Not;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class Decoder3X8 extends Wrapper {
+
+ public Decoder3X8(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+ Link enable = getInput(0);
+ Link c = getInput(1);// MSB
+ Link b = getInput(2);
+ Link a = getInput(3);// LSB
+
+ Not not_a = new Not("Not_A",a);
+ Not not_b = new Not("Not_B",b);
+ Not not_c = new Not("Not_C",c);
+
+ And and0 = new And("And0",not_a.getOutput(0),not_b.getOutput(0),not_c.getOutput(0),enable);
+ And and1 = new And("And1",a,not_b.getOutput(0),not_c.getOutput(0),enable);
+ And and2 = new And("And2",not_a.getOutput(0),b,not_c.getOutput(0),enable);
+ And and3 = new And("And3",a,b,not_c.getOutput(0),enable);
+ And and4 = new And("And4",not_a.getOutput(0),not_b.getOutput(0),c,enable);
+ And and5 = new And("And5",a,not_b.getOutput(0),c,enable);
+ And and6 = new And("And6",not_a.getOutput(0),b,c,enable);
+ And and7 = new And("And7",a,b,c,enable);
+
+ addOutput(and0.getOutput(0));
+ addOutput(and1.getOutput(0));
+ addOutput(and2.getOutput(0));
+ addOutput(and3.getOutput(0));
+ addOutput(and4.getOutput(0));
+ addOutput(and5.getOutput(0));
+ addOutput(and6.getOutput(0));
+ addOutput(and7.getOutput(0));
+
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/Decoder5X32.java b/src/simulator/wrapper/wrappers/Decoder5X32.java
new file mode 100644
index 0000000..e82c1db
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/Decoder5X32.java
@@ -0,0 +1,64 @@
+package simulator.wrapper.wrappers;
+
+import simulator.control.Simulator;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class Decoder5X32 extends Wrapper {
+
+ public Decoder5X32(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+ Link a = getInput(0);
+ Link b = getInput(1);
+ Link c = getInput(2);
+ Link d = getInput(3);
+ Link e = getInput(4);
+
+ Decoder3X8 d0 = new Decoder3X8("Dec_0","4X8",Simulator.trueLogic,Simulator.falseLogic,a,b);
+ Decoder3X8 d1 = new Decoder3X8("Dec_1","4X8",d0.getOutput(0),c,d,e);
+ Decoder3X8 d2 = new Decoder3X8("Dec_2","4X8",d0.getOutput(1),c,d,e);
+ Decoder3X8 d3 = new Decoder3X8("Dec_3","4X8",d0.getOutput(2),c,d,e);
+ Decoder3X8 d4 = new Decoder3X8("Dec_4","4X8",d0.getOutput(3),c,d,e);
+
+ addOutput(d1.getOutput(0));
+ addOutput(d1.getOutput(1));
+ addOutput(d1.getOutput(2));
+ addOutput(d1.getOutput(3));
+ addOutput(d1.getOutput(4));
+ addOutput(d1.getOutput(5));
+ addOutput(d1.getOutput(6));
+ addOutput(d1.getOutput(7));
+
+ addOutput(d2.getOutput(0));
+ addOutput(d2.getOutput(1));
+ addOutput(d2.getOutput(2));
+ addOutput(d2.getOutput(3));
+ addOutput(d2.getOutput(4));
+ addOutput(d2.getOutput(5));
+ addOutput(d2.getOutput(6));
+ addOutput(d2.getOutput(7));
+
+ addOutput(d3.getOutput(0));
+ addOutput(d3.getOutput(1));
+ addOutput(d3.getOutput(2));
+ addOutput(d3.getOutput(3));
+ addOutput(d3.getOutput(4));
+ addOutput(d3.getOutput(5));
+ addOutput(d3.getOutput(6));
+ addOutput(d3.getOutput(7));
+
+ addOutput(d4.getOutput(0));
+ addOutput(d4.getOutput(1));
+ addOutput(d4.getOutput(2));
+ addOutput(d4.getOutput(3));
+ addOutput(d4.getOutput(4));
+ addOutput(d4.getOutput(5));
+ addOutput(d4.getOutput(6));
+ addOutput(d4.getOutput(7));
+
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/Multiplexer16x1.java b/src/simulator/wrapper/wrappers/Multiplexer16x1.java
new file mode 100644
index 0000000..c65d7fa
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/Multiplexer16x1.java
@@ -0,0 +1,23 @@
+package simulator.wrapper.wrappers;
+
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class Multiplexer16x1 extends Wrapper {
+
+ public Multiplexer16x1(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+ Multiplexer8x1 m1 = new Multiplexer8x1("mux1","11x1",getInput(1),getInput(2),getInput(3));
+ Multiplexer8x1 m2 = new Multiplexer8x1("mux2","11x1",getInput(1),getInput(2),getInput(3));
+ Multiplexer2x1 m3 = new Multiplexer2x1("mux3","3x1",getInput(0));
+ m1.addInput(getInput(4),getInput(5),getInput(6),getInput(7),getInput(8),getInput(9),getInput(10),getInput(11));
+ m2.addInput(getInput(12),getInput(13),getInput(14),getInput(15),getInput(16),getInput(17),getInput(18),getInput(19));
+
+ m3.addInput(m1.getOutput(0),m2.getOutput(0));
+ addOutput(m3.getOutput(0));
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/Multiplexer2x1.java b/src/simulator/wrapper/wrappers/Multiplexer2x1.java
new file mode 100644
index 0000000..60c7c85
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/Multiplexer2x1.java
@@ -0,0 +1,29 @@
+package simulator.wrapper.wrappers;
+
+import simulator.control.Simulator;
+import simulator.gates.combinational.And;
+import simulator.gates.combinational.Not;
+import simulator.gates.combinational.Or;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class Multiplexer2x1 extends Wrapper {
+
+
+ public Multiplexer2x1(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+ And and1 = new And("AND1");
+ And and2 = new And("AND2");
+ Or or1 = new Or("OR1");
+ Not not1 = new Not("Not1");
+ not1.addInput(getInput(0));
+ and1.addInput(getInput(1),not1.getOutput(0));
+ and2.addInput(getInput(0),getInput(2));
+ or1.addInput(and1.getOutput(0),and2.getOutput(0));
+ addOutput(or1.getOutput(0));
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/Multiplexer32x1.java b/src/simulator/wrapper/wrappers/Multiplexer32x1.java
new file mode 100644
index 0000000..67bc754
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/Multiplexer32x1.java
@@ -0,0 +1,30 @@
+package simulator.wrapper.wrappers;
+
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class Multiplexer32x1 extends Wrapper {
+
+ public Multiplexer32x1(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+ Multiplexer16x1 m1 = new Multiplexer16x1("mux1","20x1",getInput(1),getInput(2),getInput(3),getInput(4));
+ Multiplexer16x1 m2 = new Multiplexer16x1("mux2","20x1",getInput(1),getInput(2),getInput(3),getInput(4));
+ Multiplexer2x1 m3 = new Multiplexer2x1("mux2","3x1",getInput(0));
+
+ for (int i = 5 ; i < 21 ; i++){
+ m1.addInput(getInput(i));
+ }
+
+ for (int i = 21 ; i < 37 ; i++){
+ m2.addInput(getInput(i));
+ }
+
+
+ m3.addInput(m1.getOutput(0),m2.getOutput(0));
+ addOutput(m3.getOutput(0));
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/Multiplexer4x1.java b/src/simulator/wrapper/wrappers/Multiplexer4x1.java
new file mode 100644
index 0000000..acec514
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/Multiplexer4x1.java
@@ -0,0 +1,22 @@
+package simulator.wrapper.wrappers;
+
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class Multiplexer4x1 extends Wrapper {
+
+
+ public Multiplexer4x1(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+ Multiplexer2x1 m1 = new Multiplexer2x1("MUX1","3x1",getInput(1),getInput(2),getInput(3));
+ Multiplexer2x1 m2 = new Multiplexer2x1("MUX2","3x1",getInput(1),getInput(4),getInput(5));
+ Multiplexer2x1 m3 = new Multiplexer2x1("MUX3","3x1",getInput(0),m1.getOutput(0),m2.getOutput(0));
+
+ addOutput(m3.getOutput(0));
+
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/Multiplexer8x1.java b/src/simulator/wrapper/wrappers/Multiplexer8x1.java
new file mode 100644
index 0000000..13d80d9
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/Multiplexer8x1.java
@@ -0,0 +1,21 @@
+package simulator.wrapper.wrappers;
+
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class Multiplexer8x1 extends Wrapper {
+
+
+ public Multiplexer8x1(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+ Multiplexer4x1 m1 = new Multiplexer4x1("MUX1","6x1",getInput(1),getInput(2),getInput(3),getInput(4),getInput(5),getInput(6));
+ Multiplexer4x1 m2 = new Multiplexer4x1("MUX1","6x1",getInput(1),getInput(2),getInput(7),getInput(8),getInput(9),getInput(10));
+ Multiplexer2x1 m3 = new Multiplexer2x1("MUX1","3x1",getInput(0),m1.getOutput(0),m2.getOutput(0));
+
+ addOutput(m3.getOutput(0));
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/PCUpdate.java b/src/simulator/wrapper/wrappers/PCUpdate.java
new file mode 100644
index 0000000..6e2dbd1
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/PCUpdate.java
@@ -0,0 +1,153 @@
+package simulator.wrapper.wrappers;
+
+
+import simulator.control.Simulator;
+import simulator.gates.combinational.And;
+import simulator.gates.sequential.Clock;
+
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class PCUpdate extends Wrapper {
+
+ public PCUpdate(String label, String stream, Link... links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+
+
+ DFlipFlop[] pc = new DFlipFlop[32];
+ for (int i=0 ; i<32 ; ++i)
+ pc[i] = new DFlipFlop("PC" + i,"2X2");
+
+
+ Adder adder = new Adder("ADDER", "64X33");
+
+ Link[] adderIn = new Link[32]; //It keeps 4
+ for (int i = 0 ; i<29 ; ++i)
+ adderIn[i] = Simulator.falseLogic;
+ adderIn[29] = Simulator.trueLogic;
+ adderIn[30] = Simulator.falseLogic;
+ adderIn[31] = Simulator.falseLogic;
+
+
+ Multiplexer2x1[] select = new Multiplexer2x1[32];
+
+ for (int i=0 ; i<32 ; ++i)
+ select[i] = new Multiplexer2x1("MUX" + i, "3X1");
+
+
+ // select the PC input
+ DFlipFlop[] shift = new DFlipFlop[2];
+ shift[0] = new DFlipFlop("SH0","2X2",getInput(0), Simulator.falseLogic);
+ shift[1] = new DFlipFlop("SH1","2X2",getInput(0), shift[0].getOutput(0));
+
+
+
+ Adder adder0 = new Adder("ADDER0","64X33");
+
+ Link[] four = new Link[32]; //It keeps 4
+ for (int i = 0 ; i<29 ; ++i)
+ four[i] = Simulator.falseLogic;
+ four[29] = Simulator.trueLogic;
+ four[30] = Simulator.falseLogic;
+ four[31] = Simulator.falseLogic;
+
+ TwosComplement tComplement = new TwosComplement("TWO's","32X32",four);
+ for (int i=1 ; i<33 ; ++i)
+ adder0.addInput(getInput(i)); // first PC address
+ for (int i=0 ; i<32 ; ++i)
+ adder0.addInput(tComplement.getOutput(i));
+
+
+
+
+
+ for (int i=0 ; i<32 ; ++i)
+ select[i].addInput(shift[1].getOutput(0),
+ pc[i].getOutput(0),adder0.getOutput(i+1));
+
+
+
+ adder.addInput(adderIn);
+ for (int i=0; i<32; ++i)
+ adder.addInput(select[i].getOutput(0)); //calculate PC+4
+
+
+ ///////////////////////////////////////////////////////////////
+
+ //beq_offset
+ Link[] beq_offset = new Link[16];
+ for(int i=0 ; i<16 ; i++)
+ beq_offset[i]=getInput(i+33);
+
+
+ SignExtend se1 = new SignExtend("SIGNEX1","16X32",beq_offset);
+
+ Adder adder1 = new Adder("ADDER1","64X33");
+ for(int i=2 ; i<32 ; i++)
+ adder1.addInput(se1.getOutput(i));
+ adder1.addInput(Simulator.falseLogic);
+ adder1.addInput(Simulator.falseLogic);
+
+ for (int i=0 ; i<32 ; ++i)
+ adder1.addInput(adder.getOutput(i+1));
+
+
+ And and = new And("AND0",getInput(75),getInput(76));
+ // the first one is zero flag and the other one is beq flag
+
+ Multiplexer2x1[] select1 = new Multiplexer2x1[32];
+ for (int i=0 ; i<32 ; ++i)
+ select1[i] = new Multiplexer2x1("MUX" + i, "3X1");
+
+ for (int i=0 ; i<32 ; ++i)
+ select1[i].addInput(and.getOutput(0),adder.getOutput(i+1),adder1.getOutput(i+1));
+
+ //////////////////////////////////////////////////////////////////
+
+
+ //jmp_offset
+ Link[] jmp_offset = new Link[26];
+ for(int i=0 ; i<26 ; i++)
+ jmp_offset[i]=getInput(i+49);
+
+
+ // jump muxs ( the selector(jump flag) is false here )
+ Multiplexer2x1[] select2 = new Multiplexer2x1[32];
+
+ for (int i=0 ; i<32 ; ++i)
+ select2[i] = new Multiplexer2x1("MUX" + i, "3X1");
+
+ for (int i=0 ; i<4 ; ++i)
+ select2[i].addInput(getInput(77),
+ select1[i].getOutput(0),adder.getOutput(i+1));
+ for (int i=4 ; i<30 ; ++i)
+ select2[i].addInput(getInput(77),
+ select1[i].getOutput(0),jmp_offset[i-4]);
+
+ select2[30].addInput(getInput(77),
+ select1[30].getOutput(0),Simulator.falseLogic);
+ select2[31].addInput(getInput(77),
+ select1[31].getOutput(0),Simulator.falseLogic);
+
+
+
+ for (int i=0 ; i<32 ; ++i)
+ pc[i].addInput(getInput(0),select2[i].getOutput(0));
+
+
+
+
+
+ // see the new PC address
+ for (int i=0; i<32; ++i)
+ addOutput(pc[i].getOutput(0));
+
+
+
+ }
+}
+
diff --git a/src/simulator/wrapper/wrappers/RealDFlipFlop.java b/src/simulator/wrapper/wrappers/RealDFlipFlop.java
index bd09cb2..6cd971d 100644
--- a/src/simulator/wrapper/wrappers/RealDFlipFlop.java
+++ b/src/simulator/wrapper/wrappers/RealDFlipFlop.java
@@ -9,6 +9,8 @@ public RealDFlipFlop(String label, String stream, Link... links) {
super(label, stream, links);
}
+
+
@Override
public void initialize() {
Nand n1 = new Nand("NAND1");
diff --git a/src/simulator/wrapper/wrappers/RegisterFile.java b/src/simulator/wrapper/wrappers/RegisterFile.java
new file mode 100644
index 0000000..5393419
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/RegisterFile.java
@@ -0,0 +1,79 @@
+package simulator.wrapper.wrappers;
+
+import simulator.control.Simulator;
+import simulator.gates.combinational.And;
+import simulator.gates.combinational.Not;
+import simulator.gates.combinational.Or;
+import simulator.gates.sequential.Clock;
+
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+import java.util.ArrayList;
+
+public class RegisterFile extends Wrapper {
+// public ArrayList> Registers ;
+
+ public RegisterFile(String label, String stream,Link... links) {
+
+ super(label, stream, links);
+
+
+
+
+ }
+
+ @Override
+ public void initialize() {
+ ArrayList> Registers = new ArrayList>(32);
+
+
+ Decoder5X32 decoder0 = new Decoder5X32("Dec1","5x32",getInput(2),getInput(3),getInput(4),getInput(5),getInput(6));
+ Link clk = getInput(0);
+ Link write = getInput(1);
+
+ ArrayList d0 = new ArrayList<>();
+ for (int i = 0 ; i < 32 ; i++){
+ d0.add(new DFlipFlop("D0_0", "2x2",clk,Simulator.falseLogic));
+ }
+ Registers.add(d0);
+
+ for (int i = 1 ; i < 32 ; i++){
+ ArrayList d = new ArrayList<>();
+ for (int j = 0 ; j < 32 ; j++){
+ DFlipFlop flipFlop = new DFlipFlop(String.format("D%d_%d",i,j),"2x2", clk);
+ And select = new And("And",write,decoder0.getOutput(i));
+ Multiplexer2x1 mux = new Multiplexer2x1("MUX_2x1","3x1",select.getOutput(0),flipFlop.getOutput(0),getInput(j+17));
+ flipFlop.addInput(mux.getOutput(0));
+ d.add(flipFlop);
+ }
+
+ Registers.add(d);
+ }
+
+
+
+
+
+ for (int i = 0 ; i < 32 ; i++){
+ Multiplexer32x1 m1 = new Multiplexer32x1("MUX","37x1");
+ m1.addInput(getInput(7),getInput(8),getInput(9),getInput(10),getInput(11));
+ for ( int j = 0 ; j < 32 ; j++){
+ m1.addInput(Registers.get(j).get(i).getOutput(0));
+ }
+ addOutput(m1.getOutput(0));
+ }
+
+
+
+ for (int i = 0 ; i < 32 ; i++){
+ Multiplexer32x1 m2 = new Multiplexer32x1("MUX","37x1");
+ m2.addInput(getInput(12),getInput(13),getInput(14),getInput(15),getInput(16));
+ for ( int j = 0 ; j < 32 ; j++){
+ m2.addInput(Registers.get(j).get(i).getOutput(0));
+ }
+ addOutput(m2.getOutput(0));
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/simulator/wrapper/wrappers/SignExtend.java b/src/simulator/wrapper/wrappers/SignExtend.java
new file mode 100644
index 0000000..64b97dd
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/SignExtend.java
@@ -0,0 +1,35 @@
+package simulator.wrapper.wrappers;
+
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class SignExtend extends Wrapper {
+
+ public SignExtend(String label, String stream, Link ...links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+
+// for(int i=0 ; i<16 ; i++) {
+// getOutputs().set(i , (getInputs().get(0)));
+// }
+//
+// for(int i=16 ; i<32 ; i++) {
+// getOutputs().set(i , (getInputs().get(i-15)));
+// }
+
+
+ for(int i=0 ; i<16 ; i++)
+ addOutput(getInput(0));
+
+ for(int i=16 ; i<32 ; i++)
+ addOutput(getInput(i-16));
+
+
+ }
+
+
+
+}
diff --git a/src/simulator/wrapper/wrappers/TwosComplement.java b/src/simulator/wrapper/wrappers/TwosComplement.java
new file mode 100644
index 0000000..a468905
--- /dev/null
+++ b/src/simulator/wrapper/wrappers/TwosComplement.java
@@ -0,0 +1,40 @@
+package simulator.wrapper.wrappers;
+
+
+
+import simulator.control.Simulator;
+import simulator.gates.combinational.Not;
+import simulator.network.Link;
+import simulator.wrapper.Wrapper;
+
+public class TwosComplement extends Wrapper {
+
+ public TwosComplement(String label, String stream, Link[] links) {
+ super(label, stream, links);
+ }
+
+ @Override
+ public void initialize() {
+
+ Not not1 = new Not("NOT1");
+ int size = getInputs().size();
+
+ for(int i=0 ; i< size ; i++)
+ not1.addInput(getInput(i));
+
+ Adder adder1 = new Adder("ADDER1","64X33");
+ for(int j=0 ; j < size ; j++)
+ adder1.addInput(not1.getOutput(j));
+
+ for(int h=0 ; h<(size-1) ; h++)
+ adder1.addInput(Simulator.falseLogic);
+ adder1.addInput(Simulator.trueLogic);
+
+
+ for(int k=1 ; k [m[1;32mSm_mE[m[33m)[m
+Merge: 718baaa 8dff27f
+Author: Sm_mE
+Date: Mon Jul 20 17:34:49 2020 +0430
+
+ Merge branch 'Rayan_Hd' of https://github.com/mamad79esh/Processor into Sm_mE
+
+[33mcommit 8dff27f1165d8f3399d8a596771ee65146c542b0[m[33m ([m[1;31morigin/Rayan_Hd[m[33m)[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Mon Jul 20 17:00:45 2020 +0430
+
+ Add files via upload
+
+[33mcommit 3cb22b693b8ac56dfff133777e9fab0db8a95614[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Mon Jul 20 17:00:09 2020 +0430
+
+ Delete Sample.java
+
+[33mcommit aeb0061609d7430a2c663d7dd2582a1827e9debf[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Mon Jul 20 11:27:07 2020 +0430
+
+ Add files via upload
+
+[33mcommit 718baaad53bfe69a7ad9faa89b11a2b22381d6e1[m[33m ([m[1;31morigin/Sm_mE[m[33m)[m
+Author: Sm_mE
+Date: Mon Jul 20 11:26:49 2020 +0430
+
+ test
+
+[33mcommit 0bf9169a3d9df9d89317cfb932966373001935ef[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Mon Jul 20 11:26:44 2020 +0430
+
+ Delete Twos_complement.java
+
+[33mcommit 00786d2291a7a71b8080a266a4a5407e743e0574[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Mon Jul 20 11:16:28 2020 +0430
+
+ Delete Sample.java
+
+[33mcommit ef193e8eea0595a78469bb793f11be8a70ed5237[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Mon Jul 20 11:15:54 2020 +0430
+
+ Delete Twos_complement.java
+
+[33mcommit 1fc4b67669424f4088396e453d3031fd8a2ea254[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Mon Jul 20 11:04:58 2020 +0430
+
+ Add files via upload
+
+[33mcommit 800af68326300c7c5ea4a5ca6fc6c5d0057fcd92[m
+Author: Sm_mE
+Date: Sun Jul 19 17:47:16 2020 +0430
+
+ Add jump to Decoders and RegisterFile
+
+[33mcommit 540a989d4051ff1161ce646c3fd1c7136a8fb2e0[m
+Author: Sm_mE
+Date: Sun Jul 19 12:43:24 2020 +0430
+
+ Add jump to control unit
+
+[33mcommit f46b288e102f31464e0ae795507bdcc11cbc9c66[m
+Author: Sm_mE
+Date: Sun Jul 19 12:10:51 2020 +0430
+
+ Add Control unit sample
+
+[33mcommit 416c7203cb7b93621f7efc2d194f786c85e49ac4[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Sun Jul 19 11:41:42 2020 +0430
+
+ Add files via upload
+
+[33mcommit 36340ba75044aa4beb90323fb0c830726c8d9b2f[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Sun Jul 19 11:41:17 2020 +0430
+
+ Delete Sample.java
+
+[33mcommit ec757de0bf541735ebffcd396e37c3f5bb456296[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Sun Jul 19 11:40:32 2020 +0430
+
+ Add files via upload
+
+[33mcommit e7e081e176385975237fd3f191c5378e8ce82024[m
+Author: Sm_mE
+Date: Sun Jul 19 10:53:50 2020 +0430
+
+ Add Control Unit
+
+[33mcommit 41ef04e0936e4c99b83242293b1f5da6d152c90d[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Sun Jul 19 09:44:54 2020 +0430
+
+ Add files via upload
+
+[33mcommit 0494787722122d87aaf65ffa220e83d21a77cbdd[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Sun Jul 19 09:44:29 2020 +0430
+
+ Add files via upload
+
+[33mcommit 924ee7a45d0b932aad1f557700b4bae5f8d7b01f[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Sun Jul 19 09:43:27 2020 +0430
+
+ Delete SignExtend.java
+
+[33mcommit 55679ee7030116da12ca292a2236fc49269fa7b2[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Sun Jul 19 09:43:15 2020 +0430
+
+ Delete Sample.java
+
+[33mcommit e7e76fdf7990e4a9bb3fdd4dbc96e487e8e859e6[m
+Author: Sm_mE
+Date: Sun Jul 19 09:40:47 2020 +0430
+
+ Add multiplexers
+
+[33mcommit 54e6b64dfff3a45c259a54ad81f63f21b3b2bde0[m
+Author: RayanHdd <68460959+RayanHdd@users.noreply.github.com>
+Date: Sat Jul 18 22:40:11 2020 +0430
+
+ Add files via upload
+
+ signExtend(not working yet!)
+
+[33mcommit 39d36f21b6cce6072b9c807eeb017abc5ce755cd[m
+Author: Sm_mE
+Date: Sat Jul 18 16:53:37 2020 +0430
+
+ start commit