Forum Discussion
Altera_Forum
Honored Contributor
15 years agoSorting in FPGA
Does anyone have any experience with doing sorting on FPGAs? Anything else to consider other than a simple bubble sort? Im going to need to sort up to 25 values (fixed at 10 or 25) to find th...
Altera_Forum
Honored Contributor
15 years agoIn 2006 I spent a couple of evenings to do a median of up to 9 elements. It comes down to what Dave says: you compare every element to every other element and you tally the comparisons for every element. The element whose tally equals the median index is the result. I did the work in AHDL, so it is fairly cumbersome to expand to 25 elements. Comparing only the 4 upper bits for 9 elements uses 287 LC in a Stratix EP1S25 and fully pipelined (3 stages) achieves 175 MHz. I estimate 25 elements to use about 2400 LC : ((e * (e - 1)) / 2 ) * (cw * 2)