--- Quote Start ---
no kaz, you didn't under stand me well
every address (duration) has its unique code
put all i want to separate the content of the ram ordered i.e i want to get the code ordered in a separate output from addressees ordered because i will use the ordered codes only
--- Quote End ---
that is easier then.
imagine your addresses are coming at random: 201, 300,,13,1012 (for associated data: 20,30,40,50)
you write to addresses 201(20), 300(30), 13(40), 1012(50)
Now you get data ready to be read out starting from address 0 to 1023 and discard any zero data so you will get:
addr data
13 => 40
201 => 20
300 => 30
1012 => 50
so your output stream will be: 40,20,30,50 in ascending order of duration(address)
Is that what you want?