dstr
Newbie level 2
Hi all,
Let's suppose that I want to implement a AND gate with registered output.
Googling for examples I found this:
Verilog:
In VHDL I would write like that:
My first question is:
In VHDL I must explicitly test both 'reset' and 'clk'.
In Verilog testing 'reset' is enough! Why?
My second question is:
In Verilog I can't mix in the same sensitivity list, both level-sensitivity and edge-sensitivity signals.
Giving that constraint, how can I implement in Verilog, the equivalent of the VHDL code below:
Thank you
Danis
Let's suppose that I want to implement a AND gate with registered output.
Googling for examples I found this:
Verilog:
Code:
always @(posedge clk or posedge reset)
begin
if (reset)
output <= 1'b0;
else
output <= a & b;
end
In VHDL I would write like that:
Code:
process (clk, reset)
begin
if (reset = '1') then
output <= '0';
elsif rising_edge(clk) then
output <= a AND b;
end if;
end;
My first question is:
In VHDL I must explicitly test both 'reset' and 'clk'.
In Verilog testing 'reset' is enough! Why?
My second question is:
In Verilog I can't mix in the same sensitivity list, both level-sensitivity and edge-sensitivity signals.
Giving that constraint, how can I implement in Verilog, the equivalent of the VHDL code below:
Code:
process (a, b, c)
begin
if rising_edge(a) then
output <= b AND c;
end if;
end;
Thank you
Danis
Last edited: