Operator
Kathryn provide these standard operation on Any Logic Variable (described in variable section)
- You may notice that some of operation in Kathryn is too constrained compared to Verilog. It happens because I need to prevent bug or misunderstanding while testing the system in this version.
1. Bitwise Operation
-
Type Declaration Size Mismatch Handling Output Size & a & b LUE max(sa, sb) | a | b LUE max(sa, sb) ^ a ^ b LUE max(sa, sb) ~ ~a - sa << a << b - sa >> a >> b - sa
2. Logical Operation
-
Type declaration Size Mismatch Handling Output Size && a && b LUE 1 || a || b LUE 1 ! !a - 1
3. arithmetic Operation
-
Type declaration Size Mismatch Handling Output Size + a + b LUE max(sa, sb) - a - b LUE max(sa, sb) * a * b LUE max(sa, sb) / a / b LUE max(sa, sb) % a % b LUE max(sa, sb)
4. Relation Operation
-
Type Declaration Size Mismatch Handling Output Size == A == B LUE 1 != A != B LUE 1 < A < B LUE 1 <= A <= B LUE 1 > A > B LUE 1 >= A >= B LUE 1 sign less than A.slt(B) LSE 1 sign greater than A.sgt(B) LSE 1
5. bit extension
-
Type Declaration NOTE Output Size Bit Extend A.extB(C) C has to be a constant C++ integer C Unsigned Extend A.uext(C) C has to be a constant C++ integer C Signed Extend A.sext(C) C has to be a constant C++ integer C