1 package net.mograsim.logic.core.components.gates;
\r
3 import java.util.List;
\r
5 import net.mograsim.logic.core.components.BasicComponent;
\r
6 import net.mograsim.logic.core.timeline.Timeline;
\r
7 import net.mograsim.logic.core.wires.Wire.ReadEnd;
\r
8 import net.mograsim.logic.core.wires.Wire.ReadWriteEnd;
\r
10 public class NotGate extends BasicComponent
\r
13 private ReadWriteEnd out;
\r
15 public NotGate(Timeline timeline, int processTime, ReadEnd in, ReadWriteEnd out)
\r
17 super(timeline, processTime);
\r
19 in.registerObserver(this);
\r
24 protected void compute()
\r
26 out.feedSignals(in.getValues().not());
\r
29 public ReadEnd getIn()
\r
34 public ReadEnd getOut()
\r
40 public List<ReadEnd> getAllInputs()
\r
46 public List<ReadWriteEnd> getAllOutputs()
\r
48 return List.of(out);
\r