gpt4 book ai didi

延迟 vhdl 中的信号

转载 作者:行者123 更新时间:2023-12-01 07:34:00 24 4
gpt4 key购买 nike

我想在 vhdl 中延迟几个周期的信号,但我在使用 how to delay a signal for several cycles in vhdl 时遇到问题

我不需要注册信号吗?我的意思是,类似:


a_store and a_store_registered would be std_logic_vector(cycles_delayed-1 downto 0)

process(clk)
begin
if rising_edge(clk) then
a_store_registered <= a_store;
end if;
end process;
a_out <= a_store_registered(cycles_delayed-1);

process(a_store_registered, a)
begin
a_store <= a_store_registered(size-2 downto 0) & a;
end process;

最佳答案

您链接到的解决方案注册信号 - 使用 rising_edge(clk) 限定符在进程内写入信号的行为会创建寄存器。

延迟线的更简单的实现可以在一行代码中实现(如果您想将高位复制到输出,还可以添加另一行)

a_store <= (a_store(a_store'high-1 downto 0) & a) when rising_edge(clk);
a_out <= a_store(a_store'high);

不知道为什么我没有在对链接问题的回答中提到这一点!

关于延迟 vhdl 中的信号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11849140/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com