home *** CD-ROM | disk | FTP | other *** search
- class EightBitSerInShiftReg extends IntegratedCircuit {
- public EightBitSerInShiftReg(Pin[][] var1, int var2, int var3) {
- super(var2, var3, 10, 15, 3, 1, 4, 13, 3, 8);
- super.IPin[0] = new InputPin("C1", 1, 2, 2, 0, 0, 0, 4);
- super.IPin[1] = new InputPin("R", 1, 4, 2, 0, 0, 0, 1);
- super.IPin[2] = new InputPin("D", 1, 6, 2, 0, 0, 0, 8);
- super.OPin[0] = new OutputPin("1", 9, 6, -2, 0, 0, 0, 0);
- super.OPin[1] = new OutputPin("2", 9, 7, -2, 0, 0, 0, 0);
- super.OPin[2] = new OutputPin("3", 9, 8, -2, 0, 0, 0, 0);
- super.OPin[3] = new OutputPin("4", 9, 9, -2, 0, 0, 0, 0);
- super.OPin[4] = new OutputPin("5", 9, 10, -2, 0, 0, 0, 0);
- super.OPin[5] = new OutputPin("6", 9, 11, -2, 0, 0, 0, 0);
- super.OPin[6] = new OutputPin("7", 9, 12, -2, 0, 0, 0, 0);
- super.OPin[7] = new OutputPin("8", 9, 13, -2, 0, 0, 0, 0);
- super.ComponentName = "8-bit serial in shift register";
- super.ClassName = "EightBitSerInShiftReg";
- ((ElectronicComponent)this).RegisterPins(var1, var2, var3);
- }
-
- public EightBitSerInShiftReg(ElectronicComponent var1, int var2, int var3) {
- super(var1, var2, var3);
- }
-
- public ElectronicComponent Copy(int var1, int var2) {
- EightBitSerInShiftReg var3 = new EightBitSerInShiftReg(this, var1, var2);
- return var3;
- }
-
- public void SimulateLogic() {
- if (super.IPin[0].OldLevel == 0 && super.IPin[0].getLevel() == 5) {
- for(int var2 = 7; var2 > 0; --var2) {
- super.OPin[var2].setLevel(super.OPin[var2 - 1].getLevel());
- }
-
- super.OPin[0].setLevel(super.IPin[2].getLevel());
- } else {
- for(int var1 = 0; var1 < 8; ++var1) {
- super.OPin[var1].setLevel(super.OPin[var1].getLevel());
- }
- }
-
- if (super.IPin[1].getLevel() == 5) {
- for(int var3 = 0; var3 < 8; ++var3) {
- super.OPin[var3].setLevel(0);
- }
- }
-
- super.IPin[0].OldLevel = super.IPin[0].getLevel();
- }
-
- public void Simulate(int var1) {
- ((ElectronicComponent)this).InformConnectedComponentsOldLevel(var1);
- }
- }
-