public Switches(Int32 width, params Boolean[] switchesOn) { _width = width; _switches = new Boolean[_width]; _defaults = new Boolean[_width]; Outputs = new OutputEndpointCollection <OutputEndpoint>(_width); Set(switchesOn); }
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)); }
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); }