Пример #1
0
 //public NAND(Node Input1, Node Input2, Node Out)
 //{
 //    Input[0] = Input1;
 //    Input[1] = Input2;
 //    Output = Out;
 //}
 public override short? calculateMinInputs(short? x, short? y)
 {
     short? result = null;
      AND and = new AND(x, y, result);
      NOT not = new NOT(result, result);
     return result;
 }
        private void createGateDueToType(object sender, PaintEventArgs e)
        {
            //switch can be replaced by a one line of code using runtime Creation ((gotta GOOGLE it))
            Gate g;
            switch (gateType)
            {
                case "OR":
                    g = new OR();
                    break;
                case "NOT":
                    g = new NOT();
                    break;
                case "AND":
                    g = new AND();
                    break;
                case "NAND":
                    g = new NAND();
                    break;

                default:
                    g = null;
                    break;
            }
            g.Draw(sender, e);
        }
Пример #3
0
 public override void calculate()
 {
     Node tempOut = new Node();
      AND and = new AND(InputNodesList[0], InputNodesList[1], tempOut);
      and.validate();
      NOT not = new NOT(tempOut, Output);
      not.validate();
 }
Пример #4
0
        //public NAND(Node Input1, Node Input2, Node Out)
        //{
        //    Input[0] = Input1;
        //    Input[1] = Input2;
        //    Output = Out;

        //}
        public override short?calculateMinInputs(short?x, short?y)
        {
            short?result = null;
            AND   and    = new AND(x, y, result);
            NOT   not    = new NOT(result, result);

            return(result);
        }
Пример #5
0
        public override void calculate()
        {
            Node tempOut = new Node();
            AND  and     = new AND(InputNodesList[0], InputNodesList[1], tempOut);

            and.validate();
            NOT not = new NOT(tempOut, Output);

            not.validate();
        }