示例#1
0
        //checks output when changing control bit
        public override bool TestGate()
        {
            Control.Value = 1;
            String first_string  = "[";
            String second_string = "[";

            for (int i = 0; i < Size; i++)
            {
                Input[i].Value = 1;
                first_string   = first_string + "1";
                second_string  = second_string + "0";
            }
            first_string  = first_string + "]";
            second_string = second_string + "]";
            if (!Output1.ToString().Equals(second_string) || !Output2.ToString().Equals(first_string))
            {
                return(false);
            }

            Control.Value = 0;
            if (!Output1.ToString().Equals(first_string) || !Output2.ToString().Equals(second_string))
            {
                return(false);
            }

            return(true);
        }