A
alomar
Guest
hi all,
I have a vhdl process question. For a vector 'x', I want to derive its
unary or-reduction value, so I just write the following codes.
Strangely, it doesn't work. So I transformed it to a function version
which is proved to be correct.
My question is what is the difference between these two methods.
Thanks for your answering.
-----------------------------------------------------------------------
signal x : std_logic_vector(10 downto 0);
process(x)
variable result : std_logic :='0';
begin
for i in x'RANGE loop
result := result or x(i);
end loop;
or_reduce_x <= result;
end process;
-------------------------------------------------------------------------
I have a vhdl process question. For a vector 'x', I want to derive its
unary or-reduction value, so I just write the following codes.
Strangely, it doesn't work. So I transformed it to a function version
which is proved to be correct.
My question is what is the difference between these two methods.
Thanks for your answering.
-----------------------------------------------------------------------
signal x : std_logic_vector(10 downto 0);
process(x)
variable result : std_logic :='0';
begin
for i in x'RANGE loop
result := result or x(i);
end loop;
or_reduce_x <= result;
end process;
-------------------------------------------------------------------------