B
BAC
Guest
I'm new to verilog coming from VHDL and trying to code a synthesizable
flip flop where the reset has presidence over the clock and the
reset is level-sensitive rather than edge sensitive.
In other words, what is the verilog equivalent to the common VHDL:
p_example : process( nRST, clk )
begin
if ( nRST = '0' ) then
output <= '0';
elsif rising_edge( clk ) then
output <= data;
end if;
end process;
Several books suggest this verilog for an asynchronous reset:
always @( negedge nRST, posedge clk )
if ( ! nRST )
output <= 0
else
output <= data;
But this, if I understand correctly, will only preform the reset if its
level actually changes ( from high to low ) because the 'always' statement
is only sensitive to edges.
This is for Cyclone II and Quartus but I doubt that this it matters.
Thanks.
flip flop where the reset has presidence over the clock and the
reset is level-sensitive rather than edge sensitive.
In other words, what is the verilog equivalent to the common VHDL:
p_example : process( nRST, clk )
begin
if ( nRST = '0' ) then
output <= '0';
elsif rising_edge( clk ) then
output <= data;
end if;
end process;
Several books suggest this verilog for an asynchronous reset:
always @( negedge nRST, posedge clk )
if ( ! nRST )
output <= 0
else
output <= data;
But this, if I understand correctly, will only preform the reset if its
level actually changes ( from high to low ) because the 'always' statement
is only sensitive to edges.
This is for Cyclone II and Quartus but I doubt that this it matters.
Thanks.