Hey
Thanks for your help. First I tried with reset but I actually got same results as before. But I kept in my mind that simulator doesn't know what value it should give at the start of simulation.
So I added extra PIN in the beginning with '1' value and that solved my problem. I guess it is hard way of doing it but at least it works well now ;)
Just adding the picture of diagram and results I wanted to get (modulo 10).
https://www.alteraforum.com/forum/attachment.php?attachmentid=14415 https://www.alteraforum.com/forum/attachment.php?attachmentid=14416