Dijskstra
Newbie level 5
- Joined
- Jun 28, 2014
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 93
Hi all,
I know that in VHDL we can declare local variables like this:
In the same way, can we declare local signals like the code below?
And what about in Verilog?
Thank you
Anders
I know that in VHDL we can declare local variables like this:
Code:
process(clk, reset)
variable v : integer;
begin
if (reset = '1') then
v := 0;
elsif rising_edge(clk) then
v := v + 1;
end process;
In the same way, can we declare local signals like the code below?
Code:
process(clk, reset)
signal s : integer;
begin
if (reset = '1') then
s <= 0;
elsif rising_edge(clk) then
s <= s + 1;
end process;
And what about in Verilog?
Thank you
Anders