integer overflow in VHDL
hey,
Can someone help me why I get the following integer overflow error
CODE:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity conv is
port(sum: out std_logic_vector(28 downto 0)
);
end conv;
architecture behav of conv is
signal s : integer range 0 to 31 := 31;
begin -- behav
sum <= conv_std_logic_vector((64-2**s) mod 2**29, 29);
end behav;
ERROR LOG:
Error! integer overflow
File: ./test1.vhd, line = 25, pos = 37
Scope: :$PROCESS_000
Time: 0 FS + 0
./test1.vhd:25 sum <= conv_std_logic_vector((64-2**s) mod 2**29, 29);
Set "intovf_severity_level" ncsim tcl variable to ignore this error.
Type `help -variable intovf_severity_level` on ncsim> prompt.
The maximum integer that can be used in VHDL is 2**31 -1 which mean that I can never used computations above that like for instance 2**31 itself? Any help is appreciated. Thanks
hey,
Can someone help me why I get the following integer overflow error
CODE:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity conv is
port(sum: out std_logic_vector(28 downto 0)
);
end conv;
architecture behav of conv is
signal s : integer range 0 to 31 := 31;
begin -- behav
sum <= conv_std_logic_vector((64-2**s) mod 2**29, 29);
end behav;
ERROR LOG:
Error! integer overflow
File: ./test1.vhd, line = 25, pos = 37
Scope: :$PROCESS_000
Time: 0 FS + 0
./test1.vhd:25 sum <= conv_std_logic_vector((64-2**s) mod 2**29, 29);
Set "intovf_severity_level" ncsim tcl variable to ignore this error.
Type `help -variable intovf_severity_level` on ncsim> prompt.
The maximum integer that can be used in VHDL is 2**31 -1 which mean that I can never used computations above that like for instance 2**31 itself? Any help is appreciated. Thanks
Last edited: