I was wondering if there's a special way to treat numeric literal constant in way similar to C language… i.e. in C we can do something like:
1LL //signed long long
1ULL //unsigned long long
etc
is there something similar in VHDL that I'm not aware of?
Best Answer
In VHDL, the constant declaration requires that the type is specified. The length is usually baked in to the type. For example
Whenever a signal is driven by a numeric constant, it's necessary to match the constant length with the signal length.
For example:
Since VHDL is strongly typed, if the literal length does not match the signal declaration, it will produce an error.
As jeff mentioned, it's also possible to use to_unsigned, as follows: