Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
- Md Multan Biswas
June 21, 2022, 2:51 pm

Dear VHDL Coders,
I am trying to get the rank of elements from an array of data. For example, I have an array, Voltage = [20 40 10 30] ;
The position of the elements in the voltage array is ranged from 0 to 3.
Using a bubble sorting algorithm, I obtained the position index of the elements in the array as follows:
Index (0)= 2 ; Index (1)= 0 ; Index (2)= 3 ; Index (3)= 1 ;
However, basically I just the rank of the elements in the voltage array. I expect to get:
Rank (0) = 1 ; Rank (1) = 3 ; Rank (2) = 0 ; Rank (3) = 2 ;
I would appreciate any of your help and suggestion to get the desired outcome using the VHDL code. Thanks, a bunch in advance :)
I am trying to get the rank of elements from an array of data. For example, I have an array, Voltage = [20 40 10 30] ;
The position of the elements in the voltage array is ranged from 0 to 3.
Using a bubble sorting algorithm, I obtained the position index of the elements in the array as follows:
Index (0)= 2 ; Index (1)= 0 ; Index (2)= 3 ; Index (3)= 1 ;
However, basically I just the rank of the elements in the voltage array. I expect to get:
Rank (0) = 1 ; Rank (1) = 3 ; Rank (2) = 0 ; Rank (3) = 2 ;
I would appreciate any of your help and suggestion to get the desired outcome using the VHDL code. Thanks, a bunch in advance :)

Re: Getting Rank of Elements in an Array using VHDL
Md Multan Biswas schrieb am Dienstag, 21. Juni 2022 um 08:51:22 UTC-6:

e, I have an array, Voltage = [20 40 10 30] ;


ements in the array as follows:

I expect to get:

come using the VHDL code. Thanks, a bunch in advance :)
If you are asking how to sort from largest-to-smallest instead of smallest-
to-largest, that is easy to do by a slight changed of the algorithm or by a
wire-reversal at the end of the sort.
I recently built a sorter (in Verilog) and I found that the best sort algor
ithm for hardware, if you are doing a full-parallel sort, is the Batcher Od
d-Even Mergesort. I did not find any good HDL examples, though, and had to
start from scratch. The Bitonic Sort is OK, but not quite as efficient in
hardware. If you have a lot of time, a parallelized bubble sort might wor
k fine.

e, I have an array, Voltage = [20 40 10 30] ;


ements in the array as follows:

I expect to get:

come using the VHDL code. Thanks, a bunch in advance :)
If you are asking how to sort from largest-to-smallest instead of smallest-
to-largest, that is easy to do by a slight changed of the algorithm or by a
wire-reversal at the end of the sort.
I recently built a sorter (in Verilog) and I found that the best sort algor
ithm for hardware, if you are doing a full-parallel sort, is the Batcher Od
d-Even Mergesort. I did not find any good HDL examples, though, and had to
start from scratch. The Bitonic Sort is OK, but not quite as efficient in
hardware. If you have a lot of time, a parallelized bubble sort might wor
k fine.
Site Timeline
- » First CFP: The 12th World Congress on Information and Communication Technologies (WICT'22)...
- — Previous thread in » Field-Programmable Gate Arrays
-
- » Getting Rank of Elements in an Array using VHDL
- — Newest thread in » Field-Programmable Gate Arrays
-
- » Abgerissene Platinenkontakte reparieren.
- — The site's Newest Thread. Posted in » Electronics (German)
-
- » (PDF) Sabiston and Spencer Surgery of the Chest - 2 Vol Set 9th Ed by Sellke
- — The site's Last Updated Thread. Posted in » Embedded Programming
-