arithmetic operations between logic vectors and constants

Guest #3758482
Rate this post
useful
not useful
what is the prefered option of arithmetic operations using  logic 
vectors and constant? convert logic vector to integer and do the 
operation or to convert the constant to logic vector?

I have samples from A/D as logic vectors with some resolution and 
constants. I want to do arithmetic operations between them according to 
formula?
if anyone has examples of such thing it will be very helpfull (VHDL).
Moderator (Company: Titel) #3758681
Rate this post
useful
not useful
Never ever do an arithmetic calculation on a unconstrained vector. For 
calculating you have signed, unsigned and integer data types.

Why? When calculating with std_logic_vectors you cannot determine 
whether its an unsigned or a signed operation. And if you simply copy 
the few lines with the calculation you discard this information.

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now