如何用VHDL实现栈/队列等数据结构?

发布于 2024-07-14 11:40:25 字数 93 浏览 3 评论 0原文

如何在 VHDL 中模拟堆栈或队列的行为? 有什么指点吗?

我曾想过使用诸如位的逻辑移位操作之类的东西,但是如何检查堆栈为空的约束或堆栈溢出的情况?

How can I simulate the behavior of a stack or a queue in VHDL? Any pointers?

I had thought of using some thing like logical shift operation of bits but how to check the constraints of stack being empty or the case of stack overflow?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

遥远的她 2024-07-21 11:40:25

您可以从阅读 Peter Ashenden 的书“The Designer's Guide to VHDL”开始。
在第 19 章中,他实现了一个排队网络,并详细解释了如何在 VHDL 上实现队列。
您可以在以下位置获取该书的 VHDL 文件: http://www. csee.umbc.edu/help/VHDL/ashenden/ch_19/

You can start by reading Peter Ashenden book "The Designer's Guide to VHDL".
On chapter 19 he implements a Queuing Network and he goes at length to explain how to implement queues on VHDL.
You can get the VHDL files for that book at: http://www.csee.umbc.edu/help/VHDL/ashenden/ch_19/

┈┾☆殇 2024-07-21 11:40:25

如果您使用 VHDL/Verilog,您将需要实现 FIFO。 如果要在实际的 FPGA 中实例化,您将使用指向 FPGA 中块 RAM 的读写指针对 FIFO 进行建模。 查看 OpenCores 上成熟的实现...

http://opencores.org/project,versatile_fifo

You will want to implement a FIFO if you are working in VHDL/Verilog. If this is going to be instantiated in an actual FPGA, you will model the FIFO with read and write pointers to block ram in the FPGA. Check out a well-developed implementation at OpenCores...

http://opencores.org/project,versatile_fifo

就是爱搞怪 2024-07-21 11:40:25

不要实现堆栈。 使用FPGA供应商的核心。

Don't implement a stack. Use the FPGA vendor's core.

情绪 2024-07-21 11:40:25

您可以制作一个 RAM 组件并将其用作 FIFO、LIFO 或您想要的各种数据结构。

如果你需要一个堆栈,在创建RAM组件后不要使用地址总线,创建一个包含堆栈顶部地址的变量。 然后用 POP 减少它(首先将输出发送到数据总线)并用 PUSH 增加它(然后将输入保存到 TOS[栈顶]变量)。

如果您需要更多,我可以告诉您更多...

you can make a RAM Component and use it as FIFO, LIFO or every kind of data structure you want.

if you need a Stack, after making RAM Component don't use Address bus for it, make a variable which contain Top Of Stack address. then with POP decrease it (first send the output to Data Bus) and with PUSH increase it (then save the input to TOS[top of stack] Variable).

if you need more I can tell you more...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文