I dont really understand the problem. Please could you explain what the issue is. Your code sets enable to '1' when DATA is between the THRESHOLD values on DATA2.
NOTE. Why is everything declared as std_logic_vector, and not unsigned? doing all these type conversions makes it harder to read and may end up giving you an RSI.
I dont really understand the problem. Please could you explain what the issue is. Your code sets enable to '1' when DATA is between the THRESHOLD values on DATA2.
Your problem is one of wrap around. The 2nd compare will wrap around to a very high unsigned number.
Why not used the signed type instead to avoid this problem?
Would be even better if DATA, DATA2 and THRESHOLD are signed data types in the first place. There is absolutly no need for them to be std_logic_vectors. Ports can be unsigned/signed.
What is your question? You have only posted a snippet and a waveform with different signal names to what is in your code.
Please ask a question and post the whole code if you have an issue.