I'm trying to convert a decimal number that is greater than 2^31 to a 32 bit unsigned number.
mem_i <= to_unsigned(2952790016, 32);
I have numeric_std included. It throws the error on compile:
Error: ./src/test_tb.vhd(147): near "2952790016": (vcom-119) Integer value exceeds INTEGER'high.
# ** Warning: [14] ./src/test_tb.vhd(147): (vcom-1144) Value -1342177280 is out of std.standard.natural range 0 to 2147483647.
Firstly, why is this looking at INTEGER'high? Shouldn't a to_unsigned() be looking at a NATURAL? Secondly, isn't the natural range up to 2^32-1 (4294967295)?
Any explanation about integers, naturals, and type conversions would be appreciated.
mem_i <= to_unsigned(2952790016, 32);
I have numeric_std included. It throws the error on compile:
Error: ./src/test_tb.vhd(147): near "2952790016": (vcom-119) Integer value exceeds INTEGER'high.
# ** Warning: [14] ./src/test_tb.vhd(147): (vcom-1144) Value -1342177280 is out of std.standard.natural range 0 to 2147483647.
Firstly, why is this looking at INTEGER'high? Shouldn't a to_unsigned() be looking at a NATURAL? Secondly, isn't the natural range up to 2^32-1 (4294967295)?
Any explanation about integers, naturals, and type conversions would be appreciated.