Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

According to the latest official figures, 43% of all statistics are totally worthless.


devel / comp.arch.fpga / Getting Rank of Elements in an Array using VHDL

SubjectAuthor
* Getting Rank of Elements in an Array using VHDLMd Multan Biswas
`- Re: Getting Rank of Elements in an Array using VHDLKevin

1
Getting Rank of Elements in an Array using VHDL

<5531692f-8b77-44b7-a399-259e3cb5478dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=285&group=comp.arch.fpga#285

  copy link   Newsgroups: comp.arch.fpga
X-Received: by 2002:a5d:53c6:0:b0:21b:8398:471 with SMTP id a6-20020a5d53c6000000b0021b83980471mr18751106wrw.386.1655823077861;
Tue, 21 Jun 2022 07:51:17 -0700 (PDT)
X-Received: by 2002:aca:211a:0:b0:333:401b:286b with SMTP id
26-20020aca211a000000b00333401b286bmr4140382oiz.196.1655823077268; Tue, 21
Jun 2022 07:51:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.fpga
Date: Tue, 21 Jun 2022 07:51:17 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=129.252.22.24; posting-account=xwVASgoAAACztTGqDXJh_wgNfAJSyqWd
NNTP-Posting-Host: 129.252.22.24
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5531692f-8b77-44b7-a399-259e3cb5478dn@googlegroups.com>
Subject: Getting Rank of Elements in an Array using VHDL
From: multan.i...@gmail.com (Md Multan Biswas)
Injection-Date: Tue, 21 Jun 2022 14:51:17 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Md Multan Biswas - Tue, 21 Jun 2022 14:51 UTC

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 :)

Re: Getting Rank of Elements in an Array using VHDL

<38a5bfba-1a1f-4a77-beab-a6bb4eade133n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=286&group=comp.arch.fpga#286

  copy link   Newsgroups: comp.arch.fpga
X-Received: by 2002:adf:eb84:0:b0:21b:84dd:4d86 with SMTP id t4-20020adfeb84000000b0021b84dd4d86mr18051300wrn.288.1655830007438;
Tue, 21 Jun 2022 09:46:47 -0700 (PDT)
X-Received: by 2002:a05:6870:608f:b0:fe:340d:df8e with SMTP id
t15-20020a056870608f00b000fe340ddf8emr20450519oae.15.1655830006862; Tue, 21
Jun 2022 09:46:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.fpga
Date: Tue, 21 Jun 2022 09:46:46 -0700 (PDT)
In-Reply-To: <5531692f-8b77-44b7-a399-259e3cb5478dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=73.243.179.79; posting-account=6H39ewoAAAAZKbcmfkx26Exr31H36wK9
NNTP-Posting-Host: 73.243.179.79
References: <5531692f-8b77-44b7-a399-259e3cb5478dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <38a5bfba-1a1f-4a77-beab-a6bb4eade133n@googlegroups.com>
Subject: Re: Getting Rank of Elements in an Array using VHDL
From: kevin_ne...@yahoo.com (Kevin)
Injection-Date: Tue, 21 Jun 2022 16:46:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Kevin - Tue, 21 Jun 2022 16:46 UTC

Md Multan Biswas schrieb am Dienstag, 21. Juni 2022 um 08:51:22 UTC-6:
> 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 :)

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 algorithm for hardware, if you are doing a full-parallel sort, is the Batcher Odd-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 work fine.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor