Forum Discussion
Altera_Forum
Honored Contributor
10 years agoOh. it's easy.
for example, let's give name for expression (new_temperature minus old_temprature) dT, then we need to know the sign of dT. so if temprature has 16 bit, you should extend the dT by 1 bit, so dT is 17 bit if it is negative so you have direction = down, otherwise direction = up if dT /= 0, in other case it is untouched. but you can introduce 'temp_change' like condition3 and asssign it like condtion3 := (dT /= 0); So you problem may be clear if you'll write the graph for yourself on paper and determine several condition from your hysteris painted on peace of paper. Finally, if condition3 = false so temprature doesn't change. then you can use outside you hysteresis condition3 = true and condition1 = true - it means temparure move towards small values, condition3 = true and condition2 = true - it means temprature move towards big values inside you hysteresis you can make yourself.