Merge branch 'wire_array_inputs_update'
[Mograsim.git] / era.mi / src / era / mi / logic / components / gates / NotGate.java
1 package era.mi.logic.components.gates;
2
3 import era.mi.logic.Util;
4 import era.mi.logic.components.BasicComponent;
5 import era.mi.logic.wires.WireArray;
6 import era.mi.logic.wires.WireArray.WireArrayInput;
7
8 public class NotGate extends BasicComponent
9 {
10         private WireArray in, out;
11         private WireArrayInput outI;
12
13         
14         public NotGate(int processTime, WireArray in, WireArray out)
15         {
16                 super(processTime);
17                 this.in = in;
18                 in.addObserver(this);
19                 this.out = out;
20                 outI = out.createInput();
21         }
22         
23         public void compute()
24         {
25                 outI.feedSignals(Util.not(in.getValues()));
26         }
27
28         public WireArray getIn()
29         {
30                 return in;
31         }
32
33         public WireArray getOut()
34         {
35                 return out;
36         }
37 }