VHDL 中的变量使用

Variable use in VHDL

我在阅读一些 VHDL 代码时看到了这个例子:

  signal     count : integer range 0 to width;
begin
  process(clk, rst)
    variable temp  : integer range 0 to width;
begin
          temp := count + 1;
          count <= temp;
end process;

这里计数信号的作用是什么?为什么我们不能只使用变量?

变量是进程的局部变量,信号用于进程之间的通信。

所以你宁愿没有变量,在这个过程中只有:

count <= count + 1;