コード例 #1
0
        public Switches(Int32 width, params Boolean[] switchesOn)
        {
            _width    = width;
            _switches = new Boolean[_width];
            _defaults = new Boolean[_width];
            Outputs   = new OutputEndpointCollection <OutputEndpoint>(_width);

            Set(switchesOn);
        }
コード例 #2
0
        public Complementor8Bits()
        {
            InitXORGates();

            Inputs  = new InputEndpointCollection <InputEndpoint>(WIDTH, _xorGates.Select(x => x.Input1 as InputEndpoint));
            _nexus  = new Nexus(WIDTH + 1, _xorGates.Select(x => x.Input2 as InputEndpoint));
            Invert  = _nexus.GetEndpointAt(WIDTH);
            Outputs = new OutputEndpointCollection <OutputEndpoint>(WIDTH,
                                                                    _xorGates.Select(x => x.Output as OutputEndpoint));
        }
コード例 #3
0
        public Complementor16Bits()
        {
            _lowerCplmtor = new Complementor8Bits();
            _upperCplmtor = new Complementor8Bits();
            _invertNexus  = new TShapedNexus(null, _lowerCplmtor.Invert, _upperCplmtor.Invert);

            var mergedInputs  = _lowerCplmtor.Inputs.Concat(_upperCplmtor.Inputs).Cast <InputEndpoint>();
            var mergedOutputs = _lowerCplmtor.Outputs.Concat(_upperCplmtor.Outputs).Cast <OutputEndpoint>();

            Inputs  = new InputEndpointCollection <InputEndpoint>(WIDTH, mergedInputs);
            Outputs = new OutputEndpointCollection <OutputEndpoint>(WIDTH, mergedOutputs);
            Invert  = _invertNexus.GetEndpointAt(0);
        }