projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Did some clean up
[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
55d0cb0
..
f664471
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,24
+1,30
@@
package era.mi.logic.components.gates;
package era.mi.logic.components.gates;
+import java.util.List;
+
import era.mi.logic.Util;
import era.mi.logic.Util;
-import era.mi.logic.WireArray;
import era.mi.logic.components.BasicComponent;
import era.mi.logic.components.BasicComponent;
+import era.mi.logic.wires.WireArray;
+import era.mi.logic.wires.WireArray.WireArrayEnd;
public class NotGate extends BasicComponent
{
private WireArray in, out;
public class NotGate extends BasicComponent
{
private WireArray in, out;
-
+ private WireArrayEnd outI;
+
public NotGate(int processTime, WireArray in, WireArray out)
{
super(processTime);
this.in = in;
in.addObserver(this);
this.out = out;
public NotGate(int processTime, WireArray in, WireArray out)
{
super(processTime);
this.in = in;
in.addObserver(this);
this.out = out;
+ outI = out.createInput();
}
}
-
+
+ @Override
public void compute()
{
public void compute()
{
- out.feedSignals(Util.not(in.getValues()));
+ out
I
.feedSignals(Util.not(in.getValues()));
}
public WireArray getIn()
}
public WireArray getIn()
@@
-30,4
+36,16
@@
public class NotGate extends BasicComponent
{
return out;
}
{
return out;
}
+
+ @Override
+ public List<WireArray> getAllInputs()
+ {
+ return List.of(in);
+ }
+
+ @Override
+ public List<WireArray> getAllOutputs()
+ {
+ return List.of(out);
+ }
}
}