Thanks for reply.
A bit more education required. :)
Nearby zero(0) means what exactly? I am getting confused with the signed
integer.
1   32bit signed integer range: 2147483647 to +2147483647

2  ENC_POS <= std_logic_vector(to_signed(p,32));

check when p is nearby 0? (p > X or p < X, where X is 10? 100? 1000?)
check at the edges? (2147483647 to +2147483647)
i was thinking like
1   index allow to clear count

2   32bit signed integer range: 2147483647 to +2147483647

3  if ENA then

4  if dr_INDEX = "01" then

5  if p > 1000 or p < 1000 then

6  EQEP_ERR <= '1';

7  p <= 0;

8  else

9  EQEP_ERR <= '0';

10  p <= 0;

11  end if;

12  end if;

13  end if;

T