Behavioral Modeling in VHDL

VHDL Programming


Behavioral Modeling :


The signal assignment statement is the most basic form of behavioral modeling in VHDL. Following is an example:


This statement is read as follows:

a gets the value of b. The effect of this statement is that the current value of signal b is assigned to signal a. This statement is executed whenever signal b changes value. Signal b is in the sensitivity list of this statement. Whenever a signal in the sensitivity list of a signal assignment statement changes value, the signal assignment statement is executed. If the result of the execution is a new value that is different from the current value of the signal, then an event is scheduled for the target signal. If the result of the execution is the same value, then no event is scheduled but a transaction is still generated. A transaction is always generated when a model is evaluated, but only signal
value changes cause events to be scheduled.

The next example shows how to introduce a nonzero delay value for the assignment:

This statement is read as follows:

a gets the value of b when 10 nanoseconds of time have elapsed.

Both of the preceding statements are concurrent signal assignment statements. Both statements are sensitive to changes in the value of signal b. Whenever b changes value, these statements execute and new values are assigned to signal a. Using a concurrent signal assignment statement, a simple AND gate can be modeled, as follows:



The AND gate has two inputs a, b and one output c, as shown in Figure. The value of signal c may be assigned a new value whenever either a or b changes value. With an AND gate, if a is a ‘0’ and b changes from a ‘1’ to a ‘0’, output c does not change. If the output does change value, then a transaction occurs which causes an event to be scheduled on signal c; otherwise, a transaction occurs on signal c.

The entity design unit describes the ports of the and2 gate. There are two inputs a and b, as well as one output c. The architecture and2_behav for entity and2 contains one concurrent signal assignment statement. This statement is sensitive to both signal a and signal b by the fact that the expression to calculate the value of c includes both a and b signal values. The value of the expression a and b is calculated first, and the resulting value from the calculation is scheduled on output c, 5 nanoseconds from the time the calculation is completed.
In another example the symbol for a four-input multiplexer is shown.

This is the behavioral model for the mux:



The entity for this model has six input ports and one output port. Four of the input ports (I0, I1, I2, I3) represent signals that will be assigned to the output signal q. Only one of the signals will be assigned to the output signal q based on the value of the other two input signals a and b. The truth table for the multiplexer is shown.


To implement the functionality described in the preceding, we use a conditional signal assignment statement and a selected signal assignment.The second statement type in this example is called a conditional signal assignment statement. This statement assigns a value to the target signal based on conditions that are evaluated for each statement. The statement WHEN conditions are executed one at a time in sequential order until the conditions of a statement are met. The first statement that matches the conditions required assigns the value to the target signal. The target signal for this example is the local signal sel. Depending on the values of signals a and b, the values 0 through 4 are assigned to sel.

If more than one statement’s conditions match, the first statement that matches does the assign, and the other matching statements’ values are ignored. The first statement is called a selected signal assignment and selects among a number of options to assign the correct value to the target signal. The target signal in this example is the signal q. The expression (the value of signal sel in this example) is evaluated, and the statement that matches the value of the expression assigns the value to the target signal. All of the possible values of the expression must have a matching choice in the selected signal assignment .

Each of the input signals can be assigned to output q, depending on the values of the two select inputs, a and b. If the values of a or b are unknown values, then the last value, ‘X’ (unknown), is assigned to output q. In this example, when one of the select inputs is at an unknown value, the output is set to unknown.

The second statement is sensitive to signals a and b. Whenever either a or b changes value, the second statement is executed, and signal sel is updated. The first statement is sensitive to signal sel. Whenever signal sel changes value, the first signal assignment is executed.



You Need "Behavioral Modeling in VHDL" ???

"Behavioral Modeling in VHDL" (Source Code / Report / PPT) Totally belong to CodingTalks Team and We always ready to Share our Stuff with our users. If you are Very Much Interested on This Topic Then you must Leave a Comment what Exactly you Looking For Or Send us Email to get Full Information.

Coding Talks

Filed in: VHDL Tags: , , , , ,

Get Updates

Share This Post

Related Posts

Leave a Reply

Submit Comment

© 2017 CodingTalks. All rights reserved.

Warning: filemtime(): stat failed for /home/codingtalks/public_html/wp-content/plugins/floating-social-share-bar//js/waypoints.min.js in /home/codingtalks/public_html/wp-content/plugins/floating-social-share-bar/floatingshare.php on line 213