Guest
Hi,
I want to describe a tolerant comparator.
The basic comparation would be:
signal old_value, new_value : integer RANGE 0 to 1023;
process(Clk)
begin
if rising_edge(Clk) then
if old_value=new_value then
ls_comp <= '1';
end if;
end if;
end process;
But what if I want to include some tolerance into that comparison ?
For example: old_value is 800
ls_comp should be asserted if new_value is within the range 799 to
801.
Does someone have an idea?
Thank you for your opinions.
Rgds
André
I want to describe a tolerant comparator.
The basic comparation would be:
signal old_value, new_value : integer RANGE 0 to 1023;
process(Clk)
begin
if rising_edge(Clk) then
if old_value=new_value then
ls_comp <= '1';
end if;
end if;
end process;
But what if I want to include some tolerance into that comparison ?
For example: old_value is 800
ls_comp should be asserted if new_value is within the range 799 to
801.
Does someone have an idea?
Thank you for your opinions.
Rgds
André