【问题标题】:how to delay a signal for several cycles in vhdl如何在 vhdl 中将信号延迟几个周期
【发布时间】:2012-08-07 23:12:09
【问题描述】:

如何在 VHDL 中将信号延迟给定数量的周期? 周期数是通用的。

任何其他选项,而不是

process(CLK) is
begin
  if rising_edge(CLK) then
    a_q <= a;
    a_q_q <= a_q;
    a_q_q_q <= a_q_q;
    -- etc
  end if;
end process;

?

【问题讨论】:

    标签: delay vhdl


    【解决方案1】:

    创建一个适当类型的信号的一维数组(我们称之为a_store),数组的长度与周期数相关。这可能意味着您必须为数组创建一个新类型,除非已经有可以使用的向量类型:例如。 std_logic_vectorinteger_vector(后者仅在 VHDL-2008 中是标准的)。

    然后沿着每个刻度打乱数组:

    if rising_edge(clk) then
      a_store <= a_store(store'high-1 downto 0) & a;
      a_out <= a_store(a_store'high);
    end if;
    

    【讨论】:

    • 让我试一试,感觉不错
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多