Question regarding the sampling values

In reply to megamind:

Hi @Megamind,

I am not sure always$rose(a) is a good coding style. But let me answer your first question:

Difference between always@(posedge a) v/s always $rose(a):

always@(posedge a) is an event which is checked instantly. It will activate in the same cycle if a is high.

While always$rose(a) is checked in different way. It checks whether a was low in the previous cycle and high in current cycle. If a is high in this cycle, procedural block always$rose(a) will get executed in the next cycle as mentioned above.