Site Search

A hardware language is required to design hardware. It is like the C language in software.

Of course, it is also necessary when designing an FPGA.

 

There are Verilog HDL, VHDL, System verilog, etc., but this time I will introduce Verilog HDL.

 

The first thing I stumbled upon learning Verilog HDL during training was the difference between procedural assignment statements and continuous assignment statements. The difference seems to be as follows.

 

Procedure assignment statements: Used when flip-flops (FF) are used and data is temporarily held.

Continuation assignment statement: Used when you want to output a combinational circuit.

たとえば、 if 文や case 文ではデータを保持したのちに出力をします。

 

I couldn't understand it even if it was written like this, so I asked my senior, and he said that there are only two types of digital circuits: combinational circuits and FF.

Grammatically, the always statement can describe both FF and combinational circuits, and the assign statement only describes combinational circuits.

So, how do we distinguish between FF and combinational circuit descriptions in the always statement?

 

It seems to make a distinction in the sensitivity list.

If the sensitivity list contains a description of a clock, it will be a circuit that uses FFs, and if the sensitivity list contains an input/output other than a clock, it will be a combinational circuit description.

It is difficult to understand even if it is written only in words, so I checked it with an actual description example and RTL Viewer.

Here is the description of the continuous assignment statement and the RTL Viewer.

 

The figure on the left is when the always statement is used, and the figure on the right is when the assign statement is used.

 

Next, here is the description of the procedure assignment statement and the RTL Viewer.

 

You can certainly see the difference between FF and combinational circuits at a glance.

 

RTL Viewer is really convenient!

 

What I learned this time was that I needed to clarify whether I wanted to build an FF or a combinational circuit, even for a simple circuit like this.