|The Int#(n) type is a signed fixed width representation of an integer value, where n indicates the number of bits. |
Int#(8) a = 'h80;
Int#(12) b = signExtend(a); // b => 'hF80
Int#(8) c = truncate(d); // c => 'h80
functions to convert a type between Bit#(n) and other types. During type checking, the compiler resolves these functions to a particular type instance. If you have excessive type conversion in your design, it usually indicates a poor choice of the basic object types in the design, and you may want to review your type choices. These conversion utilities do not incur logic overhead.