Exemple #1
0
    void Update()
    {
        if (isSimulating && timeCounter >= timeP)
        {
            bool valueA = false;

            if (counter == 0)
            {
                valueA = false;
            }
            else if (counter == 1)
            {
                valueA = true;
            }

            inputA.material = valueA ? onMat : offMat;
            bool outp = NotG.Logic(valueA);
            output.material = outp ? onMat : offMat;

            counter++;

            if (counter >= 2)
            {
                counter = 0;
            }

            timeCounter = 0.0f;
        }
        timeCounter += Time.deltaTime;
    }
Exemple #2
0
    public static bool Logic(bool inA, bool inB)
    {
        bool out1 = NotG.Logic(inA);
        bool out2 = NotG.Logic(inB);

        return(NandG.Logic(out1, out2));
    }
Exemple #3
0
    public static bool Logic(bool inA, bool inB, bool inX)
    {
        bool NotX       = NotG.Logic(inX);
        bool A_and_NotX = AndG.Logic(inA, NotX);
        bool B_and_X    = AndG.Logic(inB, inX);

        return(OrG.Logic(A_and_NotX, B_and_X));
    }
Exemple #4
0
    public static bool Logic(bool inA, bool inB)
    {
        bool notA      = NotG.Logic(inA);
        bool notB      = NotG.Logic(inB);
        bool AAnd_NotB = AndG.Logic(inA, notB);
        bool BAnd_NotA = AndG.Logic(inB, notA);

        return(OrG.Logic(AAnd_NotB, BAnd_NotA));
    }
Exemple #5
0
    public static bool[] Logic(bool inD, bool inX)
    {
        bool NotX       = NotG.Logic(inX);
        bool D_and_NotX = AndG.Logic(inD, NotX);
        bool D_and_X    = AndG.Logic(inD, inX);

        bool[] outBool = new bool[2];
        outBool[0] = D_and_NotX;
        outBool[1] = D_and_X;
        return(outBool);
    }
Exemple #6
0
 public static bool[] Logic(bool[] inA)
 {
     if (inA.Length != 16)
     {
         Debug.Log("Wrong input to Not16");
         Application.Quit();
     }
     bool[] output = new bool[16];
     for (int i = 0; i < 16; i++)
     {
         output[i] = NotG.Logic(inA[i]);
     }
     return(output);
 }
Exemple #7
0
    public static bool Logic(bool inA, bool inB)
    {
        bool out1 = NandG.Logic(inA, inB);

        return(NotG.Logic(out1));
    }