/**\r
* stdlogic according to IEEE 1164\r
*/\r
-public enum Bit {\r
+public enum Bit\r
+{\r
U, X, ZERO, ONE, Z;\r
\r
- public static Bit and(Bit a, Bit b) {\r
+ public static Bit and(Bit a, Bit b)\r
+ {\r
return a.and(b);\r
}\r
\r
- public Bit and(Bit other) {\r
+ public Bit and(Bit other)\r
+ {\r
return fromTable(AND_TABLE, this, other);\r
}\r
\r
- public static Bit or(Bit a, Bit b) {\r
+ public static Bit or(Bit a, Bit b)\r
+ {\r
return a.or(b);\r
}\r
\r
- public Bit or(Bit other) {\r
+ public Bit or(Bit other)\r
+ {\r
return fromTable(OR_TABLE, this, other);\r
}\r
\r
- public static Bit xor(Bit a, Bit b) {\r
+ public static Bit xor(Bit a, Bit b)\r
+ {\r
return a.xor(b);\r
}\r
\r
- public Bit xor(Bit other) {\r
+ public Bit xor(Bit other)\r
+ {\r
return fromTable(XOR_TABLE, this, other);\r
}\r
\r
- public Bit not() {\r
- switch (this) {\r
+ public Bit not()\r
+ {\r
+ switch (this)\r
+ {\r
case U:\r
return U;\r
case ONE:\r
}\r
}\r
\r
- public Bit[] makeArray(int length) {\r
+ public Bit[] makeArray(int length)\r
+ {\r
Bit[] bits = new Bit[length];\r
Arrays.fill(bits, this);\r
return bits;\r
}\r
\r
- public Bit combineWith(Bit other) {\r
+ public Bit combineWith(Bit other)\r
+ {\r
return fromTable(JOIN_TABLE, this, other);\r
}\r
\r
- public static Bit combine(Bit a, Bit b) {\r
+ public static Bit combine(Bit a, Bit b)\r
+ {\r
return a.combineWith(b);\r
}\r
\r
- private static Bit fromTable(Bit[][] table, Bit a, Bit b) {\r
+ private static Bit fromTable(Bit[][] table, Bit a, Bit b)\r
+ {\r
return table[a.ordinal()][b.ordinal()];\r
}\r
\r