AHDL

Declaring Nodes



A node, which is declared with a Node Declaration in the Variable Section, can be used to hold the value of an intermediate expression.

Node Declarations are especially useful when a Boolean expression is used repeatedly. The Boolean expression can be replaced with a descriptive node name, which is easier to read.

The boole2.tdf file shown below contains the same logic as boole1.tdf (shown in Implementing Boolean Expressions & Equations), but has only one output.

SUBDESIGN boole2
(
   a0, a1, b   : INPUT;
   out         : OUTPUT;
)
VARIABLE
   a_equals_2  : NODE;
BEGIN
   a_equals_2 = a1 & !a0;
   out = a_equals_2 # b;
END;

This file declares the node a_equals_2 and assigns the value of the expression a1 & !a0 to it. Using nodes can save device resources when the node is used in several expressions.

Both ordinary nodes (NODE keyword) and tri-state nodes (TRI_STATE_NODE keyword) can be used. NODE and TRI_STATE_NODE differ in that multiple assignments to them yield different results:


Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.