projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New Timeline events notify the simulation thread now
[Mograsim.git]
/
era.mi
/
src
/
era
/
mi
/
logic
/
components
/
BitDisplay.java
diff --git
a/era.mi/src/era/mi/logic/components/BitDisplay.java
b/era.mi/src/era/mi/logic/components/BitDisplay.java
index
940f69c
..
971eb7a
100644
(file)
--- a/
era.mi/src/era/mi/logic/components/BitDisplay.java
+++ b/
era.mi/src/era/mi/logic/components/BitDisplay.java
@@
-1,20
+1,22
@@
package era.mi.logic.components;
package era.mi.logic.components;
-import java.util.
Arrays
;
+import java.util.
List
;
-import era.mi.logic.Bit;
-import era.mi.logic.wires.WireArray;
+import era.mi.logic.types.Bit;
+import era.mi.logic.types.BitVector;
+import era.mi.logic.wires.Wire.WireEnd;
public class BitDisplay extends BasicComponent
{
public class BitDisplay extends BasicComponent
{
- private final Wire
Array
in;
- private Bit
[]
displayedValue;
+ private final Wire
End
in;
+ private Bit
Vector
displayedValue;
- public BitDisplay(Wire
Array
in)
+ public BitDisplay(Wire
End
in)
{
super(1);
this.in = in;
in.addObserver(this);
{
super(1);
this.in = in;
in.addObserver(this);
+ compute();
}
@Override
}
@Override
@@
-23,13
+25,25
@@
public class BitDisplay extends BasicComponent
displayedValue = in.getValues();
}
displayedValue = in.getValues();
}
- public Bit
[]
getDisplayedValue()
+ public Bit
Vector
getDisplayedValue()
{
return displayedValue;
}
public boolean isDisplaying(Bit... values)
{
{
return displayedValue;
}
public boolean isDisplaying(Bit... values)
{
- return Arrays.equals(displayedValue, values);
+ return displayedValue.equals(BitVector.of(values));
+ }
+
+ @Override
+ public List<WireEnd> getAllInputs()
+ {
+ return List.of(in);
+ }
+
+ @Override
+ public List<WireEnd> getAllOutputs()
+ {
+ return List.of();
}
}
}
}