home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / FREI / DIGSIM.EXE / DLatch.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-05-21  |  1.1 KB  |  29 lines

  1. class DLatch extends IntegratedCircuit {
  2.    public DLatch(Pin[][] var1, int var2, int var3) {
  3.       super(var2, var3, 10, 6, 3, 1, 4, 4, 2, 2);
  4.       super.IPin[0] = new InputPin("D", 1, 2, 2, 0, 0, 0, 0);
  5.       super.IPin[1] = new InputPin("C", 1, 4, 2, 0, 0, 0, 0);
  6.       super.OPin[0] = new OutputPin("Q", 9, 2, -2, 0, 0, 0, 0);
  7.       super.OPin[1] = new OutputPin("Q", 9, 4, -2, 0, 0, 0, 1);
  8.       super.ComponentName = "D-latch";
  9.       super.ClassName = "DLatch";
  10.       ((ElectronicComponent)this).RegisterPins(var1, var2, var3);
  11.    }
  12.  
  13.    public DLatch(ElectronicComponent var1, int var2, int var3) {
  14.       super(var1, var2, var3);
  15.    }
  16.  
  17.    public ElectronicComponent Copy(int var1, int var2) {
  18.       DLatch var3 = new DLatch(this, var1, var2);
  19.       return var3;
  20.    }
  21.  
  22.    public void SimulateLogic() {
  23.       if (super.IPin[1].getLevel() == 5) {
  24.          super.OPin[0].Level = super.OPin[1].Level = super.IPin[0].getLevel();
  25.       }
  26.  
  27.    }
  28. }
  29.