fixed Connector and added some useful methods to WireArray and Util
[Mograsim.git] / era.mi / src / era / mi / logic / wires / WireArray.java
index 44cd751..370cbbd 100644 (file)
@@ -7,6 +7,7 @@ import java.util.List;
 
 import era.mi.logic.Bit;
 import era.mi.logic.Simulation;
+import era.mi.logic.Util;
 
 /**
  * Represents an array of wires that can store n bits of information.
@@ -317,6 +318,18 @@ public class WireArray
        {
            return values.clone();
        }
+       
+       public Bit[] wireValuesExcludingMe() 
+       {
+               Bit[] bits = Util.arrayOfZ(length);
+               for (WireArrayInput wai : inputs) 
+               {
+                       if(wai == this)
+                               continue;
+                       Util.combineInto(bits, wai.getValues());
+               }
+               return bits;
+       }
 
        public void clearSignals()
        {