Exemple #1
0
        public bool Xnor(bool A, bool B)
        {
            NOT not = new NOT();
            XOR xor = new XOR();

            return not.Not(xor.Xor(A, B));
        }
Exemple #2
0
        public bool Nand(bool A, bool B)
        {
            NOT not = new NOT();
            AND and = new AND();

            return not.Not(and.And(A, B));
        }
Exemple #3
0
        public bool Nor(bool A, bool B)
        {
            NOT not = new NOT();
            OR or = new OR();

            return not.Not(or.Or(A, B));
        }
Exemple #4
0
        public bool Xor(bool A, bool B)
        {
            AND and = new AND();
            NOT not = new NOT();
            OR or = new OR();

            bool A_or_B = or.Or(A, B);
            bool A_and_B_negado = not.Not(and.And(A, B));
            bool saida = and.And(A_or_B, A_and_B_negado);

            return saida;
        }