Some module attributes are assigned numeric values. Data values consist of the arithmetic base, or radix, followed by the numeric data value in the specified base. LogiBLOX only allows bases 2, 4, 8, 10, and 16. The default base is decimal and does not need to be specified. The following formats are allowed.
base#value#
decimal_value
For example, the decimal value 17 can be expressed as follows.
Binary | 2#10001# | |
Base 4 | 4#101# | |
Octal | 8#21# | |
Decimal | 17 or 10#17# | |
Hexadecimal | 16#11# |
The following attributes require a numeric data value.
The Bus Width attribute also takes a numeric value, but it is restricted to decimal values between 2 and 64, inclusive.
When a constant value (C Value) is specified, the precision of the value might be less than the precision of the bus; if so, it will be sign-extended on the left (toward the MSB). If the value is greater than the precision of the bus, the higher order bits are ignored. In this case, a warning is also printed.
The following table shows the valid characters for several radices.
Base Type | Base | Valid Data Value Characters |
---|---|---|
Binary | 2 | 0 1 - _ |
Base 4 | 4 | 0 1 2 3 - _ |
Octal | 8 | 0 1 2 3 4 5 6 7 - _ |
Decimal | 10 | 0 1 2 3 4 5 6 7 8 9 - _ |
Hexadecimal | 16 | 0 1 2 3 4 5 6 7 8 9 - _ A B C D E F a b c d e f |