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 --- if there is not a value in the successive address it put a zero in content of ram (corresponding to this empty address) its wright or not?? --- Quote End --- you don't write so content stays zero --- Quote Start --- but the reverse happens i.e i have a discrete values. and i have a question to you if i want to separate the codes and the addresses that output ascending i.e the codes ordered in output and the corresponding in another output because i will use the codes that ordered to count the distances that we done before i hope you understand me well --- Quote End --- If I understood you. You are saying same duration(address) for two codes? in that case you need to tackle the problem. one way is to have wider ram and check address is written to before then put new data at same location next to previous data and flag it as two or three and so on. Or you can check in your logic and change address accordingly. You will need to work out details of your case and my above algorithm is just a guide.