always statement, namely
always @(/* condition */) /* block of code */
block of code whenever
condition is satisfied. How is such an
always block implemented in hardware?
First, note that not all Verilog designs are synthesizable. Usually, only a very specific subset of constructs can be used in a design that is to be realized in hardware.
One important restriction that pops up is that every
The following types of
In the former case, the
Registers that have affinity to
Consider the following, somewhat contrived example.
Depending on the hardware you have available, other types of constructs can be used. For example, if the flip-flops have asynchronous resets, the following construct is also synthesizable.
In an FPGA a flip-flop and a latch are generally just two different configurations of a more general-purpose register device. A multiplexer would be constructed from one or more general-purpose logic elements (LUTs).
In general, there's two ways to go about design with Verilog:
Avakar's answer is a much better one for your question, but this spurred some interesting discussion about the differences between Xilinx and Altera so I won't delete it.