D
DW
Guest
Hello,
could someone explain why it is that variables are allowed to be declared
within functions whereas nets are not. This seems counter-intuitive to me
at the moment as I thought that functions were reserved for simple
logical/mathematical combinatorial functions and I can't see how declaring a
wire would harm this. On the other hand, to declare a variable seems to be
wrong as procedural code isn't allowed in functions. I see functions as a
way to encapsulate combinatorial statements not procedural statements.
Where am I going wrong in my reasoning?
could someone explain why it is that variables are allowed to be declared
within functions whereas nets are not. This seems counter-intuitive to me
at the moment as I thought that functions were reserved for simple
logical/mathematical combinatorial functions and I can't see how declaring a
wire would harm this. On the other hand, to declare a variable seems to be
wrong as procedural code isn't allowed in functions. I see functions as a
way to encapsulate combinatorial statements not procedural statements.
Where am I going wrong in my reasoning?