Vhdl Assignment Statement In C++

Having trouble viewing in English, Choose Your Language :    


This is a brief post for beginners to Verilog language, coming from a C/Java background. Verilog differs from a conventional programming language in the sense that the execution of statements is not strictly sequential. Different code blocks are executed concurrently as opposed to the sequential execution of most programming languages. So, a beginner might get perplexed, as to what is concurrent and what is not !!

Concurrent Statements:

All statements in Verilog are concurrent (unless they are inside a sequential block as discussed later). Concurrent means that the operations described in each line take place in parallel. The commonly used concurrent constructs are gate instantiation and the continuous assignment statement.

Note that no net should be assigned a value more than once with concurrent statements.e.g

can be re-written as

but, although equivalent sequentially, it’s incorrect as both statements are concurrent, so the value of sum is indeterminate.

Sequential Statements:

Sequential statements are similar to statements in a normal programming language. A sequence of statements is regarded as describing operations that take place one after the other instead of at the same time.

  • All sequential Verilog statements must be inside a procedural block.
  • Sequential statements are placed inside a begin/end block and executed in sequential order within the block. However, the blocks themselves are executed concurrently.
  • Verilog statements outside any process block are interpreted as concurrent statements and different procedural blocks execute concurrently.

The commonly used sequential constructs are:
* Initial and always procedural blocks: Initial blocks start execution at time zero and execute only once. Always blocks loop to execute over and over again, and as the name suggests, they execute always.
* if, case structures, for and while loops: Always appear inside an always block.
Note that multiple assignment of values is allowed inside a procedural block.

Posted by Jatin Ganhotra (@jatinganhotra)Verilog

« C++ - Variable Declaration in 'if' expressionFrom Disqus to IntenseDebate & back again »

Стратмор знал, что это единственный способ избежать ответственности… единственный способ избежать позора. Он закрыл глаза и нажал на спусковой крючок. Сьюзан услышала глухой хлопок, когда уже спустилась на несколько пролетов. Звук показался очень далеким, едва различимым в шуме генераторов. Она никогда раньше не слышала выстрелов, разве что по телевизору, но не сомневалась в том, что это был за звук.

One thought on “Vhdl Assignment Statement In C++

Leave a Reply

Your email address will not be published. Required fields are marked *