X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FMux.java;fp=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FMux.java;h=6ef41b282396528c61c67333dc6a51875c0c5f4c;hb=3e6ac3d7fd389191d02c1c6982fbf093421ce4f2;hp=47fe164ad6fc04bc21dc94d57c09d89158e7f766;hpb=2e7dc40f788b00146f2d0805fecd9d23adbda363;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java index 47fe164a..6ef41b28 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Mux.java @@ -34,23 +34,23 @@ public class Mux extends BasicComponent public Mux(Timeline timeline, int processTime, ReadWriteEnd out, ReadEnd select, ReadEnd... inputs) { super(timeline, processTime); - outputSize = out.length(); + outputSize = out.width(); this.inputs = inputs.clone(); for (int i = 0; i < this.inputs.length; i++) { - if (inputs[i].length() != outputSize) - throw new IllegalArgumentException("All MUX wire arrays must be of uniform length!"); + if (inputs[i].width() != outputSize) + throw new IllegalArgumentException("All MUX wire arrays must be of uniform width!"); inputs[i].registerObserver(this); } this.select = select; select.registerObserver(this); - int maxInputs = 1 << select.length(); + int maxInputs = 1 << select.width(); if (this.inputs.length > maxInputs) throw new IllegalArgumentException("There are more inputs (" + this.inputs.length + ") to the MUX than supported by " - + select.length() + " select bits (" + maxInputs + ")."); + + select.width() + " select bits (" + maxInputs + ")."); this.out = out; }