1 package era.mi.logic.components;
3 import era.mi.logic.Bit;
4 import era.mi.logic.Simulation;
5 import era.mi.logic.timeline.TimelineEvent;
6 import era.mi.logic.timeline.TimelineEventHandler;
7 import era.mi.logic.wires.WireArray;
8 import era.mi.logic.wires.WireArray.WireArrayInput;
10 public class Clock implements TimelineEventHandler
12 private boolean toggle = false;
13 private WireArrayInput outI;
15 public Clock(WireArray out)
17 this.outI = out.createInput();
21 public void handle(TimelineEvent e)
23 Simulation.TIMELINE.addEvent(this, 50);
24 outI.feedSignals(new Bit[] { toggle ? Bit.ONE : Bit.ZERO });
28 public WireArray getOut()