X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FSplitter.java;fp=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FSplitter.java;h=04658fe4ec2077fcf318fdb1489a3c5770bfb63f;hb=3e6ac3d7fd389191d02c1c6982fbf093421ce4f2;hp=8a1ba20a2dc16a0ee7e92d422b3cc1b0d3966260;hpb=2e7dc40f788b00146f2d0805fecd9d23adbda363;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Splitter.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Splitter.java index 8a1ba20a..04658fe4 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Splitter.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/Splitter.java @@ -20,13 +20,13 @@ public class Splitter extends Component implements LogicObserver this.input = input; this.outputs = outputs; input.registerObserver(this); - int length = 0; + int width = 0; for (ReadEnd out : outputs) - length += out.length(); + width += out.width(); - if (input.length() != length) + if (input.width() != width) throw new IllegalArgumentException( - "The input of splitting one into n WireArrays must have length = a1.length() + a2.length() + ... + an.length()."); + "The input of splitting one into n WireArrays must have width = a1.width() + a2.width() + ... + an.width()."); } protected void compute() @@ -35,8 +35,8 @@ public class Splitter extends Component implements LogicObserver int startIndex = 0; for (int i = 0; i < outputs.length; i++) { - outputs[i].feedSignals(inputBits.subVector(startIndex, startIndex + outputs[i].length())); - startIndex += outputs[i].length(); + outputs[i].feedSignals(inputBits.subVector(startIndex, startIndex + outputs[i].width())); + startIndex += outputs[i].width(); } }