完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好!
我想基于几点来实现排序算法: - 我有一组存储在BRAM中的号码。 这些数字以单精度浮点格式表示,我可以拥有的最大数字是400; - 电路应该能够读取BRAM中的数字,对它们进行排序并在另一个BRAM中写入已排序的“列表”; - BRAM只有一个可用于读/写的端口; 所以我对解决这个问题的最佳方法有几点疑问: - 由于存储在BRAM中的元素数量是可变的,有没有办法动态分配内存来存储我读取的数字? 我能从中获得一些东西吗? 或者,因为我知道数字的最大大小,即使我不使用某些位置,最好有400大小的数组? - 由于我只有一个端口可用,这意味着我一次只能读一个号码,对吧? 您是否认为阅读整个BRAM更好,进行排序(使用quicksort或mergesort)然后将结果写入其他BRAM? 或者在我从BRAM阅读的同时,我也正在对已读取的数字进行某种排序(例如,插入排序)? 抱歉这些“新手”问题,但我对VHDL很新。 提前致谢。 最好的祝福! 以上来自于谷歌翻译 以下为原文 Hello everyone! I want to implement a sorting algorithm based on a few points: - I have a set of numbers stored in a BRAM. These numbers are represented in single-precision floating-point format and the maximum numbers that I can have is 400; - The circuit should be able to read the numbers from the BRAM, sort them and write the sorted "list" in another BRAM; - The BRAM's only have one port available for reading/writting; So I'm having a few questions on the best way to approach this problem: - Since the number of elements stored in the BRAM is variable, is there any way of dynamically allocate memory to store the numbers I read? Do I gain something with this? Or since I know the maximum size of numbers, it is better to have a 400 size array even if I don't use some of its positions? - Since I only have one port available, this means I can only read one number at a time, right? Do you think it is better to read the whole BRAM, do the sort (with quicksort or mergesort) and then write the result to the other BRAM? Or at the same time I am reading from the BRAM, I'm also doing some sort with the numbers already read (with insertion sort, for example)? Sorry about these "newbie" questions but I'm quite new to VHDL. Thanks in advance. Best regards! |
|
相关推荐
2个回答
|
|
*分配:fpga上可用的总内存是固定的。
您只能使用设计所引用的内存,以便实例化您需要的所有BRAM(甚至所有BRAMS)。 有一个存储器,用于存储使用量。*排序算法:确定哪种排序算法适合您的需要。 还注意到brams有一个读取,一个写入端口,它们有不同的宽高比。 实际上你可以制作1个64位宽(也就是2个数字)并且并排放多个来访问你的所有数字,你会有更多的brams但是在极端情况下你可以同时读取所有400个数字并设计400 输入比特式分拣机。 另一个极端是使用一个bram并在适当的位置排序。 - 如果提供的信息有用,请将答案标记为“接受为解决方案”。给予您认为有用且回复的帖子。 以上来自于谷歌翻译 以下为原文 * allocation: the total memory available on fpga is fixed. You can only use memory to which your design refers so instantiate all BRAMS you need (all of them even). Have a register which stores how much is used. * sort algorithm: decide which sorting algorithm suits your needs. also notice that brams have one read, one write port and they come in different aspect ratios. in fact you can make 1 bram 64 bit wide (ie 2 numbers) and put many side by side to access all your numbers, you would have a lot more brams but in the extreme case you can read all 400 numbers simultaneously and design a 400 input bitonic sorter. Other extreme is use one bram and sort in place.- Please mark the Answer as "Accept as solution" if information provided is helpful. Give Kudos to a post which you think is helpful and reply oriented. |
|
|
|
在我的情况下,我有一个Spartan 3E-FPGA,设备是XC3S100E,因此我只有4个BRAM可用,其中一个用于读取无序数字,另一个用于写入已经订购的数字!
以上来自于谷歌翻译 以下为原文 In my case, I have a Spartan 3E-FPGA and the device is the XC3S100E so I only have 4 BRAM availables from which one is just for reading the unordered numbers and another one is for writing the already ordered numbers! |
|
|
|
只有小组成员才能发言,加入小组>>
2420 浏览 7 评论
2823 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2294 浏览 9 评论
3374 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2461 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
1165浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
585浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
451浏览 1评论
2005浏览 0评论
729浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 11:16 , Processed in 1.515626 second(s), Total 79, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号