简体   繁体   中英

Variable use in VHDL

I was reading some codes in VHDL and saw this example:

  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;

what's the purpose of count signal here? Why can't we just use the variable?

Variables are local to the process, and signals are used to communicate between processes.

So you would rather do without the variable, and in the process just have:

count <= count + 1;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM