コード例 #1
0
ファイル: GateOperations.cs プロジェクト: thomas13335/smg
        internal static SumOfProducts GetSOP(this IGate garg)
        {
            var gset = new SumOfProducts();

            foreach (var i in garg.GetInputs())
            {
                if (i is TrueGate)
                {
                    gset.SetFixed(i);
                    break;
                }
                else if (i is FalseGate)
                {
                    // ignore
                }
                else
                {
                    gset.Add(i.GetProduct());
                }
            }

            return(gset);
        }
コード例 #2
0
ファイル: GateOperations.cs プロジェクト: thomas13335/smg
        internal static SumOfProducts GetSOP(this IGate garg)
        {
            var gset = new SumOfProducts();

            foreach (var i in garg.GetInputs())
            {
                if (i is TrueGate)
                {
                    gset.SetFixed(i);
                    break;
                }
                else if (i is FalseGate)
                {
                    // ignore
                }
                else
                {
                    gset.Add(i.GetProduct());
                }
            }

            return gset;
        }