Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

Holding Value in Variable until next clock cycle

Hello all,

I am writing a process in which I want to hold some data in an array. I have declared and initialized the array inside process as variable. What I want is that array should be updated in one clock cycle, then retain its data until the next clock cycle and then get updated in the next cycle and so on..

My question is whenever the next clock cycle comes, does the array reset to its initial value given in the declaration part or it will start from the previous value that was stored in it in last cycle??

if it is reset to its initial value always, then how can I store the data in array that can be used in the next cl

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It will always store the value once it is assigned - but how you use it will affect the logic that gets infered.

    If you are not sure what you're doing - you are much better off using signals.

    Why not post the code and try and explain what you're trying to do.