O
Olaf
Guest
Hi,
vhdl is very adventurously
Anyway, I wrote:
signal ts_count : std_ulogic_vector(31 downto 0);
counter: process (clk) is
constant LENGTH : positive := ts_count'length;
constant MAX_VALUE : positive := 2**LENGTH - 1;
...
begin
and got a runtime error from modelsim:
# ** Error: Value -1 is out of std.standard.positive range 1 to 2147483647.
# ** Error: Value -1 is out of std.standard.natural range 0 to 2147483647.
After some hours I found, that the ts_count vector is to long so that an
overflow of LENGTH/MAX_VALUE occurred ...
I need the MAX_VALUE since I need it to convert to gray code for further
use (generating an overflow signal).
Is there a way to use the full length of ts_count or other opportunities?
Thanks
Olaf
vhdl is very adventurously
Anyway, I wrote:
signal ts_count : std_ulogic_vector(31 downto 0);
counter: process (clk) is
constant LENGTH : positive := ts_count'length;
constant MAX_VALUE : positive := 2**LENGTH - 1;
...
begin
and got a runtime error from modelsim:
# ** Error: Value -1 is out of std.standard.positive range 1 to 2147483647.
# ** Error: Value -1 is out of std.standard.natural range 0 to 2147483647.
After some hours I found, that the ts_count vector is to long so that an
overflow of LENGTH/MAX_VALUE occurred ...
I need the MAX_VALUE since I need it to convert to gray code for further
use (generating an overflow signal).
Is there a way to use the full length of ts_count or other opportunities?
Thanks
Olaf