import era.mi.logic.Bit;
import era.mi.logic.Simulation;
-import era.mi.logic.WireArray;
import era.mi.logic.timeline.TimelineEvent;
import era.mi.logic.timeline.TimelineEventHandler;
+import era.mi.logic.wires.WireArray;
+import era.mi.logic.wires.WireArray.WireArrayInput;
public class Clock implements TimelineEventHandler
{
private boolean toggle = false;
- private WireArray w;
+ private WireArrayInput outI;
- public Clock(WireArray w)
+ public Clock(WireArray out)
{
- this.w = w;
+ this.outI = out.createInput();
}
@Override
public void handle(TimelineEvent e)
{
Simulation.TIMELINE.addEvent(this, 50);
- w.feedSignals(new Bit[] { toggle ? Bit.ONE : Bit.ZERO });
+ outI.feedSignals(new Bit[] { toggle ? Bit.ONE : Bit.ZERO });
toggle = !toggle;
}
- public WireArray getW()
+ public WireArray getOut()
{
- return w;
+ return outI.owner;
}
}