Wire concept was changed to accommodate multiple inputs. Not all
[Mograsim.git] / era.mi / src / era / mi / logic / components / gates / OrGate.java
index 06296ba..c1d95a7 100644 (file)
@@ -1,12 +1,14 @@
 package era.mi.logic.components.gates;
 
 import era.mi.logic.Util;
-import era.mi.logic.WireArray;
 import era.mi.logic.components.BasicComponent;
+import era.mi.logic.wires.WireArray;
+import era.mi.logic.wires.WireArray.WireArrayInput;
 
 public class OrGate extends BasicComponent
 {
        private WireArray a, b, out;
+       private WireArrayInput outI;
        
        public OrGate(int processTime, WireArray a, WireArray b, WireArray out)
        {
@@ -16,11 +18,12 @@ public class OrGate extends BasicComponent
                this.b = b;
                b.addObserver(this);
                this.out = out;
+               this.outI = out.createInput();
        }
 
        protected void compute()
        {
-               out.feedSignals(Util.or(a.getValues(), b.getValues()));
+               outI.feedSignals(Util.or(a.getValues(), b.getValues()));
        }
 
        public WireArray getA()