Forum Discussion
Altera_Forum
Honored Contributor
14 years agoPerhaps this would work best for for you:
- Custom hardware accelerator with two masters (one read and one write) - Dual port on-chip RAM with the accelerator masters connected each port - Slave port that you poke new data into the sorted list - Each time a new value comes in you start at the *end* of your list searching backwards to find the spot to insert it - While the step above is happening you use the write port to start moving the read data one memory location further in memory You could also reverse the data order and work your way up in memory addresses too (that would work better if you decided to put your data into SDRAM for example). This will only work efficiently up to a certain point. If you are talking about sorting really big lists of data there are better ways to do this. What I suggest above is O(n) whereas there are O(log2(n)) ways to do this sort of thing which would scale better as the data set grows. Technically you could do this with a custom instruction but you are limiting your possiblities that way, at least with a masting component you can put your data in any memory you want.