Forum Discussion
2 Replies
- Altera_Forum
Honored Contributor
What numbers are you talking about. integers are 2's compliment so effectivly has a sign bit at the MSB.
- Altera_Forum
Honored Contributor
Integers are signed type; default width of 32 bits. Natural are the whole numbers are unsigned; also default width of 32 bits. If you use the numeric_std package, then you can convert between SLV, signed and unsigned to/from integer types easily. For example;
regSLV <= std_logic_vector(to_unsigned(IntegerVariable,16)); integerVariable <= to_integer(signed(regSLV)); integerVariable <= to_integer(unsigned(regSLV));