Forum Discussion
Altera_Forum
Honored Contributor
13 years agoThe problem can be also understood as a priority encoder. It's effective implementation is discussed in the Altera Synthesis Cookbook http://www.altera.com/literature/manual/stx_cookbook.pdf and shown in the supplementing code examples.
Interestingly, Quartus isn't able to implement an optimal solution (timing- and resource-wise) from an behavioral description as suggested in the above post. Apparently Quartus isn't prepared to use the carry chain for non-arithmetical problems.