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
/
gates
/
NotGate.java
diff --git
a/era.mi/src/era/mi/logic/components/gates/NotGate.java
b/era.mi/src/era/mi/logic/components/gates/NotGate.java
index
1aba6b8
..
1c0d833
100644
(file)
--- a/
era.mi/src/era/mi/logic/components/gates/NotGate.java
+++ b/
era.mi/src/era/mi/logic/components/gates/NotGate.java
@@
-1,37
+1,48
@@
package era.mi.logic.components.gates;
package era.mi.logic.components.gates;
-import era.mi.logic.Util;
+import java.util.List;
+
import era.mi.logic.components.BasicComponent;
import era.mi.logic.components.BasicComponent;
-import era.mi.logic.wires.WireArray;
-import era.mi.logic.wires.WireArray.WireArrayInput;
+import era.mi.logic.wires.Wire.WireEnd;
public class NotGate extends BasicComponent
{
public class NotGate extends BasicComponent
{
- private Wire
Array in, out
;
- private Wire
ArrayInput outI
;
+ private Wire
End in
;
+ private Wire
End out
;
-
- public NotGate(int processTime, WireArray in, WireArray out)
+ public NotGate(int processTime, WireEnd in, WireEnd out)
{
super(processTime);
this.in = in;
in.addObserver(this);
this.out = out;
{
super(processTime);
this.in = in;
in.addObserver(this);
this.out = out;
- outI = out.createInput();
}
}
-
- public void compute()
+
+ @Override
+ protected void compute()
{
{
- out
I.feedSignals(Util.not(in.getValues()
));
+ out
.feedSignals(in.getValues().not(
));
}
}
- public Wire
Array
getIn()
+ public Wire
End
getIn()
{
return in;
}
{
return in;
}
- public Wire
Array
getOut()
+ public Wire
End
getOut()
{
return out;
}
{
return out;
}
+
+ @Override
+ public List<WireEnd> getAllInputs()
+ {
+ return List.of(in);
+ }
+
+ @Override
+ public List<WireEnd> getAllOutputs()
+ {
+ return List.of(out);
+ }
}
}