Comments are essential to the proper understanding of a code. The delimiter of comments is -- (two classic dashes in a row). To comment several lines, you must place -- on each line. It is possible to possible to place a comment at the end of a line of code. Example:
123
-- first line of a comment in VHDL-- second line of a comment in VHDLsignalU:unsigned(7downto0);-- inline comment in VHDL
It is also important in the header of a file to give information about the author of the code, the version, date of creation/modification etc.
The libraries contain mainly the definitions of the types and the arithmetic operators associated with them. The libraries to be preferred are the standard IEEE libraries. Declaration:
In the entity part, we describe the inputs and outputs of the component. We can also, via the generic define configuration parameters of the component. For example the size of some internal signals or inputs and outputs. Example of an entity with generics: