Altera_Forum
Honored Contributor
11 years agoFunction to_unsigned returns only zeros
Hello,
I'm programming a FIR Filter in VHDL and I want to insert stuck on errors in the taps.. so, I did this:
SIGNAL tap0, tap1, tap2, tap3 : INTEGER :=0 ;
SIGNAL error : INTEGER :=0; -- other problem if I don't initialize them with "0", the test bench won't run.
SIGNAL tap3std : std_logic_vector(to_unsigned(tap3, 8));
SIGNAL tap_error : to_integer(unsigned(std_logic_vector(to_unsigned(error, 8)) or tap3std));
p1 : process
begin
--here I put the equations for the FIR Filter, it works perfectly if I don't try to put any errors.
end process;
In the test bench I change the values in the taps and everything, but when I look the results, the tap3 signal works properly... but the tap3std is only zeros. :confused: Does anyone know how to fix this? Thank you, Helder. :)