\r
/**\r
* Models a multiplexer. Takes an arbitrary amount of input {@link WireArray}s, one of which, as determined by select, is put through to the\r
\r
/**\r
* Models a multiplexer. Takes an arbitrary amount of input {@link WireArray}s, one of which, as determined by select, is put through to the\r
* @param select Indexes the input array which is to be mapped to the output. Must have enough bits to index all inputs.\r
* @param inputs One of these inputs is mapped to the output, depending on the select bits\r
*/\r
* @param select Indexes the input array which is to be mapped to the output. Must have enough bits to index all inputs.\r
* @param inputs One of these inputs is mapped to the output, depending on the select bits\r
*/\r
- public Mux(int processTime, WireArray out, WireArray select, WireArray... inputs) {\r
+ public Mux(int processTime, WireArray out, WireArray select, WireArray... inputs)\r
+ {\r
if (inputs[i].length != outputSize)\r
throw new IllegalArgumentException("All MUX wire arrays must be of uniform length!");\r
inputs[i].addObserver(this);\r
if (inputs[i].length != outputSize)\r
throw new IllegalArgumentException("All MUX wire arrays must be of uniform length!");\r
inputs[i].addObserver(this);\r
ArrayList<WireArray> wires = new ArrayList<WireArray>(Arrays.asList(inputs));\r
wires.add(select);\r
return Collections.unmodifiableList(wires);\r
}\r
\r
@Override\r
ArrayList<WireArray> wires = new ArrayList<WireArray>(Arrays.asList(inputs));\r
wires.add(select);\r
return Collections.unmodifiableList(wires);\r
}\r
\r
@Override\r