Forum Discussion
Altera_Forum
Honored Contributor
12 years agosorter in vhdl
hi every one i want avhdl code to sort integer input ascending if i have an array such as 1,8,9,7,2 the out put will be such as 1,2,7,8,9 i search a lot but didn't find any code that he...
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- all codes i found gave the greater or smallest value from an array i have an array 0 to 255 for integer input and i want to order them any idea plz --- Quote End --- one method of sorting is as follows: use ram of 256 depth. use your data as address and rd/wr from that location after one increment. So for example if data is 7, read data7(0) add 1 and write back(1) continue in this manner then read back your ram contents which could be something like this: 0 : 2 1: 0 2: 5 3: 1 ...etc