1 package era.mi.logic.tests;
3 import era.mi.logic.Bit;
4 import era.mi.logic.Simulation;
5 import era.mi.logic.wires.WireArray;
6 import era.mi.logic.wires.WireArray.WireArrayInput;
7 import era.mi.logic.wires.WireArrayObserver;
9 public class Connector implements WireArrayObserver {
10 private final WireArray a;
11 // private final WireArray b;
12 private final WireArrayInput aI;
13 private final WireArrayInput bI;
15 public Connector(WireArray a, WireArray b) {
16 if (a.length != b.length)
17 throw new IllegalArgumentException(String.format("WireArray width does not match: %d, %d", a.length, b.length));
27 public void update(WireArray initiator, Bit[] oldValues) {
28 Simulation.TIMELINE.addEvent((e) -> {
30 bI.feedSignals(aI.wireValuesExcludingMe());
32 aI.feedSignals(bI.wireValuesExcludingMe());