如何在vhdl中将信号延迟几个周期

发布于 2024-12-12 09:05:10 字数 237 浏览 2 评论 0原文

如何在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;

How to delay signal for a given number of cycles in VHDL?
Number of cycles is given as a generic.

Any other options instead of

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;

?

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

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

发布评论

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

评论(1

如日中天 2024-12-19 09:05:10

创建适当类型信号的一维数组(我们称之为 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;

Create an 1-d array (let's call it a_store) of the appropriate type of signal with the length of the array related to the number of cycles. This may mean you have to create a new type for the array unless there's already a vector type you can use: eg. std_logic_vector or integer_vector (the latter is standard only in VHDL-2008).

Then shuffle the array along each tick:

if rising_edge(clk) then
  a_store <= a_store(store'high-1 downto 0) & a;
  a_out <= a_store(a_store'high);
end if;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文