Take a minimal example:

always @*
  if (in) q=d;

We know a latch would be inferred. But, since there's no clock signal, why is the latch relying on it? How can we decide which level it is sensitive to?

1

There are 1 best solutions below

0
toolic On

The latch is not relying on a clock. In your code, the latch is enabled when the in signal is 1. That means q follows the d signal.

When in=0, q does not follow d. q retains the previous value it had when in transitioned to 0.

Synthesizable constructs has a good description also; see the Transparent latch example.