X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2Fgates%2FNotGate.java;h=e1c0e607ae7d4048d498d68080ce3c3fd20baa55;hb=ecc651406020231ff0ebc8d1bfc6f916693f69c6;hp=b1cfefee2a4434092f4ef3576becac0add039ead;hpb=67c1d352795802dae0c045cedeed82c883819d4e;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/gates/NotGate.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/gates/NotGate.java index b1cfefee..e1c0e607 100644 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/gates/NotGate.java +++ b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/gates/NotGate.java @@ -1,50 +1,50 @@ -package net.mograsim.logic.core.components.gates; - -import java.util.List; - -import net.mograsim.logic.core.components.BasicComponent; -import net.mograsim.logic.core.timeline.Timeline; -import net.mograsim.logic.core.wires.Wire.ReadEnd; -import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; - -public class NotGate extends BasicComponent -{ - private ReadEnd in; - private ReadWriteEnd out; - - public NotGate(Timeline timeline, int processTime, ReadEnd in, ReadWriteEnd out) - { - super(timeline, processTime); - this.in = in; - in.addObserver(this); - this.out = out; - } - - @Override - protected void compute() - { - out.feedSignals(in.getValues().not()); - } - - public ReadEnd getIn() - { - return in; - } - - public ReadEnd getOut() - { - return out; - } - - @Override - public List getAllInputs() - { - return List.of(in); - } - - @Override - public List getAllOutputs() - { - return List.of(out); - } -} +package net.mograsim.logic.core.components.gates; + +import java.util.List; + +import net.mograsim.logic.core.components.BasicComponent; +import net.mograsim.logic.core.timeline.Timeline; +import net.mograsim.logic.core.wires.Wire.ReadEnd; +import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; + +public class NotGate extends BasicComponent +{ + private ReadEnd in; + private ReadWriteEnd out; + + public NotGate(Timeline timeline, int processTime, ReadEnd in, ReadWriteEnd out) + { + super(timeline, processTime); + this.in = in; + in.registerObserver(this); + this.out = out; + } + + @Override + protected void compute() + { + out.feedSignals(in.getValues().not()); + } + + public ReadEnd getIn() + { + return in; + } + + public ReadEnd getOut() + { + return out; + } + + @Override + public List getAllInputs() + { + return List.of(in); + } + + @Override + public List getAllOutputs() + { + return List.of(out); + } +}