Is this true to say that the following Code-1 and Code-2 are equivalent in Verilog:
Code 1
always@(posedge Clock or B or C)
begin
if (B)
A <= 0;
else if (C)
A <= 1;
end
Code 2
always@(posedge Clock or B or C)
begin
if (B)
A <= 0;
else if (C)
A <= 1;
else
A <= A;
end
Is the same thing also true in VHDL?
Code-3
process (clk, preset, reset)
begin
if (preset = ‘1’) then
ff <= ‘1’;
elsif (reset = ‘1’) then
ff <= ‘0’;
elsif (clk=’1’ and clk’event) then
ff <= ff_d;
endif;
end process
Code-4
process (clk, preset, reset)
begin
if (preset = ‘1’) then
ff <= ‘1’;
elsif (reset = ‘1’) then
ff <= ‘0’;
elsif (clk=’1’ and clk’event) then
ff <= ff_d;
else
ff <= ff;
endif;
end process
Could we also say Code-3 and Code-4 are the same?
How about the same thing about a combinatorial logic ? Can we say the followings are equivalent (Verilog example)?
code-5
always @ ( * ) begin
if ( Trigger ) begin
A = Pass ;
end
end
code-6
always @ ( * ) begin
if ( Trigger ) begin
A = Pass ;
end
else begin
A = A;
end
end
Could we also say Code-5 and Code-6 are the same? f