Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers

for loop

Altera_Forum
Honored Contributor II
1,387 Views

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
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
612 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
612 Views

ok thanks a lot :-)

0 Kudos
Altera_Forum
Honored Contributor II
612 Views

thanks a lot:D

0 Kudos
Altera_Forum
Honored Contributor II
612 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
612 Views

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

0 Kudos
Reply