--- Quote Start ---
Hi
When we use “ function” and where is its exact usage? what is the difference between it and “component”? if it is possible explain it by examples.
Thank you
--- Quote End ---
A component is basically an entity. And of course an entity is something which encapsulates your logic design. It has inputs, outputs, internal signals and whatever logic you can imagine.
A function is a bit of logic which executes in delta time, and is commonly used to implement code which gets reused. The various conversions you find in numeric_std, such as to_unsigned(), are examples of functions. Unlike its cousin the procedure, a function may not include any delay or wait mechanisms.