VHDL: Programming By Example, Fourth Edition

Appendix C: Reading VHDL BNF

After the basic concepts of VHDL are understood, the designer might want to try to write VHDL in a more elegant manner. To fully understand how to apply all of the syntactic constructs available in VHDL, it is helpful to know how to read the VHDL Bachus-Naur format (BNF) of the language. This format is in Appendix A of the IEEE Std 1076-1987 VHDL Language Reference Manual (LRM), pages A 1 to A 17. This format specifies which constructs are necessary versus optional, or repeatable versus singular, and how constructs can be associated.

BNF is basically a hierarchical description method, where complex constructs are made of successive specifications of lower-level constructs. Our purpose for examining BNF is not to understand every nuance of the BNF but to put the basics to use to help build complex VHDL constructs. To this end, let us examine some BNF and discuss what it means.

Following is the BNF for the IF statement:

<b class="bold">if_statement ::=</b><b class="bold">  IF condition THEN</b><b class="bold">    sequence_of_statements</b><b class="bold">  {ELSIF condition THEN</b><b class="bold">    sequence_of_statements}</b><b class="bold">  [ELSE</b><b class="bold">    sequence_of_statements]</b><b class="bold">  END IF;</b>

The first line of the BNF description specifies the name of the construct being described. This line is read as follows: The IF statement consists of, or The IF statement is constructed from. The rest of the description represents the rules for constructing an IF statement.

The second line of the description specifies...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Cylindrical Lenses
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.