Guest
Hello,
Are the two code snippets equivalent?
(1)
always @(posedge clk) begin
state <= 1;
if ( blah )
state <= 2;
end
(2)
always @(posedge clk) begin
if ( blah )
state <= 2;
else
state <= 1;
end
....
I ask because #1 would sometimes be better for me - set state to '1' at
the beginning, only changing it later on as required (obviously, not
'later' in real time, just later on in the code block).
Any help much appreciated
Many thanks
Are the two code snippets equivalent?
(1)
always @(posedge clk) begin
state <= 1;
if ( blah )
state <= 2;
end
(2)
always @(posedge clk) begin
if ( blah )
state <= 2;
else
state <= 1;
end
....
I ask because #1 would sometimes be better for me - set state to '1' at
the beginning, only changing it later on as required (obviously, not
'later' in real time, just later on in the code block).
Any help much appreciated
Many thanks