Пример #1
0
        public override void Run()
        {
            update_input();
            int val = 0;

            for (int i = 0; i <= 2; i++)
            {
                if ((bool)inputs_tab[i])
                {
                    val++;
                }
            }
            outputs_tab = ClassConverter.ConvertToBinary(val, 2);
            update_output();
        }
Пример #2
0
        public override void Run()
        {
            update_input();
            outputs_tab.Clear();
            int val = 0;

            while ((val < inputs_tab.Count) && ((bool)inputs_tab[val] == false))
            {
                val++;
            }
            if (val == inputs_tab.Count)
            {
                val = 0;
            }
            outputs_tab = ClassConverter.ConvertToBinary(val, nbrOutputs());
            update_output();
        }