X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FTriStateBuffer.java;h=057c49e5dbd0d953bc29cf7216f14338e2196324;hb=0ab3dafe756a69ff8b1e0137058caf2f5ac564aa;hp=f4f1b4913f467f0aa0bf8d758033a4af8244b6e8;hpb=07faf07e3acb8b2afdc2bf65a46bc868faaed0f8;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/TriStateBuffer.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/TriStateBuffer.java index f4f1b491..057c49e5 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/TriStateBuffer.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/TriStateBuffer.java @@ -15,15 +15,15 @@ public class TriStateBuffer extends BasicComponent public TriStateBuffer(Timeline timeline, int processTime, ReadEnd in, ReadWriteEnd out, ReadEnd enable) { super(timeline, processTime); - if (in.length() != out.length()) + if (in.width() != out.width()) throw new IllegalArgumentException( - "Tri-state output must have the same amount of bits as the input. Input: " + in.length() + " Output: " + out.length()); - if (enable.length() != 1) - throw new IllegalArgumentException("Tri-state enable must have exactly one bit, not " + enable.length() + "."); + "Tri-state output must have the same amount of bits as the input. Input: " + in.width() + " Output: " + out.width()); + if (enable.width() != 1) + throw new IllegalArgumentException("Tri-state enable must have exactly one bit, not " + enable.width() + "."); this.in = in; - in.addObserver(this); + in.registerObserver(this); this.enable = enable; - enable.addObserver(this); + enable.registerObserver(this); this.out = out; }