1
5 public class Main {
6 public static void main(String[] args) {
7
8 Signal x = new Signal();
10 Signal y = new Signal();
11 Signal cIn = new Signal();
12
13 FullAdder fa = new FullAdder(x, y, cIn);
15
16 x.set(true);
18 y.set(false);
19 cIn.set(false);
20
21 fa.operate();
23
24 System.out.println("sum = " + fa.getSum().get());
26 System.out.println("carryOut = " + fa.getCarryOut().get());
27
28 System.out.println("compound components: " + CompoundComponent.n);
30 System.out.println("gates: " + Gate.n);
31 System.out.println("and: " + And.n);
32 System.out.println("or: " + Or.n);
33 System.out.println("not: " + Not.n);
34
35 }
36
37 }
38