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 --- to avoid confusion you can use bit(8) as flag !! how i can do that ?? because i am really confused !! --- Quote End --- you might as well not use flag at all if your code is never all zeros. Then your problem reduces to just write/read write stage: write code per duration as address then once done go to read stage read stage: use address range either from 0 to 1023 and discard any location that contains zero (or just your known duration values and get code directly )