Thanks dave and sorry for my poor explaination
The count is generated in the module, it output the count value in random time and random value.
1 clock -> count = 1
2 clock -> count = 3
3 clock -> count = 3
4 clock -> count = 5
5 clock -> count = 3
The recovery is the output depends on the count value changes, it will be 1 when count value changed:
1 clock -> recovery = 1
2 clock -> recovery = 1 // At clock 1 to 2, count value change from 1 to 3, therefore recovery = 1
3 clock -> recovery = 0 // At clock 2 to 3, count value doesnt change, it stay at 3, therefore recovery = 0
4 clock -> recovery = 1 // At clock 3 to 4, count value change from 3 to 5, therefore recovery = 1
5 clock -> recovery = 1
What I have done is the count value. But now I dunno how can I detect the changes of count value. I have tried to store count value in each cycle and do comparison using always @, and then the recovery output will delay 1 clock cycle. If I use assign, I am not able to store the count value and do compare.
I hope I make it clear now