Esempio n. 1
0
        public FullAdderTest()
        {
            _fullAdder    = new FullAdder();
            _power1       = new PowerSupplier();
            _power2       = new PowerSupplier();
            _powerCarryIn = new PowerSupplier();
            _lightSum     = new IndicatorLight();
            _lightCarry   = new IndicatorLight();

            _fullAdder.Number1In.ConnectTo(_power1.Output);
            _fullAdder.Number2In.ConnectTo(_power2.Output);
            _fullAdder.CarryIn.ConnectTo(_powerCarryIn.Output);
            _fullAdder.Sum.ConnectTo(_lightSum.Input);
            _fullAdder.CarryOut.ConnectTo(_lightCarry.Input);
        }
Esempio n. 2
0
 private void CheckGate(IFullAdder gate, bool x,bool y, bool cIn, bool cOut, bool s)
 {
     Assert.AreEqual(new Tuple<bool,bool>(s,cOut), gate.Output(new Tuple<bool,bool,bool>(x,y,cIn)));
 }
Esempio n. 3
0
 public QuadAdder()
 {
     adder = new FullAdder();
 }