clocked for loop with conditional if...

Joined
Sep 10, 2009
Messages
1
Reaction score
0
I think this gets synthesized into a priority encoder, muxing the appropriate prioritised input to output (assume input is an array of some type, with the type being the same as output) and req is a an array of request signals. req(0) has the highest priority and req(2) the lowest. I think this saves a rather large amount of if..elsif's as an alternative to encode priority? >> Anyone else agree?...Im just puzzling it to myself.

......
elsif (clk'event and (clk = '1')) then

for priority in 0 to 2 loop

if (req(priority) ='1') then
output <= input(priority);
end if;

end loop;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top