Forum Discussion

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

for loop

Hello there,

I have a question,

i have a std_logic_vector(20 downto 0) and i want to take the value

of this vector to build a for-loop.

for example the std_logic_vector looks like that

"000000000000000000101" which is a value of 5

now i want to build a for loop so that my output

out_data = X"80008000"

fills out_data with X"80008000" 5 times befor other values are coming

Could anyone help me how i could build this for loop?

regards

5 Replies

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

    for loop isn't quite the same as in the C/software world.

    what you need to do is something like a mux which has your X"80008000" value on one input and the signal which will have the following values on the other input. a counter will count up to 5 then using a comparator will switch between the two mux inputs.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    OK thanks for that will give them a try when my HT5 Head comes back from repair

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

    HelloIm trying to do a series of Rolling Correlations using movcor command. Already did it for one series, with respect 10 other series.The problem is I need to do the same process, with respect to other series. Is there a loop I can use here, and save some time?Thanks for any suggestionsJoaquÃ*n