i just want to know the difference between this two statement
always @(posedge CLK)
begin
state <= next_state;
end
AND:
always @(CLK)
begin
case(CLK)
1'b1:
state <= next_state;
1'b0:
state <= state;
end
Is there a difference between both ?
Thanks
Best Answer
Not quite.
posedge
detects these transitions (from the LRM):So, 0->x is a
posedge
, for example. Your second example only detects cases whereCLK
ends up as 1, so misses 0->x and 0->z.