Forum Discussion
Altera_Forum
Honored Contributor
16 years agonumeric_std every time. It may have been introduced late, but that was 17 years ago! the problem is people reference old examples that are '87 standard and use std_logic_arith and stick to that.
If you have loads of casts then I think you're using it wrong. Avoid using std_logic_vector when what you really mean is unsigned/signed or even integer. Ports on entities can be signed/unsigned or integer (with a limited range) so keep signals in the same type that you meant them to be, it makes it more readable. Avoid using altera megafunctions when you can imply them in the code (like using arrays to infer altsyncrams - you can use arrays of integers for this too!). You cannot do signed and unsigned arithmatic in the same file with std_logic_arith. If you ever tried to do fixed point arithmatic, you'd probably want to use numeric_std instead, or even better the new fixed point packages which are based on numeric_std. If you never have anything more than a counter or 2, then I can understand people sticking with std_logic_arith - but its best to build up a habit and stick with it. Many engineers I know that use are often building controllers and never do algorithm generation.