1 package era.mi.logic.components.gates;
3 import java.util.Arrays;
4 import java.util.Collections;
7 import era.mi.logic.Util;
8 import era.mi.logic.components.BasicComponent;
9 import era.mi.logic.wires.WireArray;
10 import era.mi.logic.wires.WireArray.WireArrayInput;
12 public class XorGate extends BasicComponent
14 private WireArray a, b, out;
15 private WireArrayInput outI;
17 public XorGate(int processTime, WireArray a, WireArray b, WireArray out)
27 protected void compute()
29 outI.feedSignals(Util.xor(a.getValues(), b.getValues()));
32 public WireArray getA()
37 public WireArray getB()
42 public WireArray getOut()
48 public List<WireArray> getAllInputs()
50 return Collections.unmodifiableList(Arrays.asList(a, b));
54 public List<WireArray> getAllOutputs()
56 return Collections.unmodifiableList(Arrays.asList(out));