Exemplo n.º 1
0
        public void CreateNewWithOutputEndpointCollection()
        {
            IOutputEndpointCollection <IOutputEndpoint> outputs = new OutputEndpointCollection <OutputEndpoint>(3);
            Nexus nexus = new Nexus(3, outputs);

            Assert.IsNotNull(nexus);
        }
Exemplo n.º 2
0
        public Adder8Bits()
        {
            InitFullAdders();

            Number1Inputs = new InputEndpointCollection <InputEndpoint>(WIDTH, _fullAdders.Select(a => a.Number1In as InputEndpoint));
            Number2Inputs = new InputEndpointCollection <InputEndpoint>(WIDTH, _fullAdders.Select(a => a.Number2In as InputEndpoint));
            CarryInput    = _fullAdders[0].CarryIn;
            SumOutputs    = new OutputEndpointCollection <OutputEndpoint>(WIDTH, _fullAdders.Select(a => a.Sum as OutputEndpoint));
            CarryOutput   = _fullAdders[WIDTH - 1].CarryOut;
        }
Exemplo n.º 3
0
        public Adder16Bits()
        {
            _lowerAdder = new Adder8Bits();
            _upperAdder = new Adder8Bits();
            _lowerAdder.CarryOutput.ConnectTo(_upperAdder.CarryInput);

            var inputpointsNumber1 = _lowerAdder.Number1Inputs.Concat(_upperAdder.Number1Inputs).Cast <InputEndpoint>();
            var inputpointsNumber2 = _lowerAdder.Number2Inputs.Concat(_upperAdder.Number2Inputs).Cast <InputEndpoint>();
            var outputsSum         = _lowerAdder.SumOutputs.Concat(_upperAdder.SumOutputs).Cast <OutputEndpoint>();

            Number1Inputs = new InputEndpointCollection <InputEndpoint>(WIDTH, inputpointsNumber1);
            Number2Inputs = new InputEndpointCollection <InputEndpoint>(WIDTH, inputpointsNumber2);
            CarryInput    = _lowerAdder.CarryInput;
            SumOutputs    = new OutputEndpointCollection <OutputEndpoint>(WIDTH, outputsSum);
            CarryOutput   = _upperAdder.CarryOutput;
        }