Пример #1
0
        public static bool Do(bool s, bool d1, bool d0)
        {
            var nand1 = Gates.Nand(s, d1);

            var nand2 = Gates.Nand(Gates.Invert(s), d0);

            return(Gates.Nand(nand1, nand2));
        }
Пример #2
0
        public static Bit2 HalfAdder(bool a, bool b)
        {
            var nandAb = Gates.Nand(a, b);

            var nand1 = Gates.Nand(a, nandAb);
            var nand2 = Gates.Nand(b, nandAb);

            var nand3 = Gates.Nand(nand1, nand2);

            var nand5 = Gates.Nand(nandAb, nandAb);

            return(new Bit2(nand5, nand3));
        }
Пример #3
0
        public void False_false_should_return_true()
        {
            var res = Gates.Nand(false, false);

            res.Should().BeTrue();
        }
Пример #4
0
        public void True_true_should_return_false()
        {
            var res = Gates.Nand(true, true);

            res.Should().BeFalse();
        }