【发布时间】: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;
?
【问题讨论】:
如何在 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;
?
【问题讨论】:
创建一个适当类型的信号的一维数组(我们称之为a_store),数组的长度与周期数相关。这可能意味着您必须为数组创建一个新类型,除非已经有可以使用的向量类型:例如。 std_logic_vector 或 integer_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;
【讨论】: