function "to_integer"

OP (Company: LERICA) #3876017
Rate this post
useful
not useful
I have a problem when using this function and i have this message : 
"Argument of 'to_integer' function must have size less than 32"

from what I understand, the to_integer function from numeric_std works 
with 32 bits vectors max!!!
is there a way to make it accept 64 bits vectors? ou more?
or is there some other function i should use?

Thank you a lot,
Regards,
Guest #3876208
Rate this post
useful
not useful
What programming language do you use?
Maybe the function name is to_long, or you could transform the 64Bit 
vector to 32bit, this truncates the information in the lower 32Bit but 
maybe the precision is enough for your purpose.

Why would you transform to integer datatype, if your datatype is double 
just round it and keep the double datatype
OP (Company: LERICA) #3876284
Rate this post
useful
not useful
Peter Kremsner wrote:
> What programming language do you use?
> Maybe the function name is to_long, or you could transform the 64Bit
> vector to 32bit, this truncates the information in the lower 32Bit but
> maybe the precision is enough for your purpose.
>
> Why would you transform to integer datatype, if your datatype is double
> just round it and keep the double datatype


Thanks for your quickly response,

I use VHDL language (xilinx ISE),
The program concerns manipulation of image block data in order to
achieve a motion estimation, I use a register (32bits) for saving (or
delaying) the data, thus the program works when data size is less than
32-bits but in my case I need 64-bits, so how can I do this?

Thank you,
OP (Company: LERICA) #3877204
Rate this post
useful
not useful
Peter Kremsner wrote:
> Truncate the 64 Bit to 32 Bit or use 2 32Bit Register for saving the
> data.
> 1 for the low 32Bit the other for the high 32Bit and perform the
> operation with two registers.


Thank you again for your valuable comments,
I did as you mentioned, I split my data into two parts, once using 
32-bit registers, and the second part another 32-bit registers, only I 
hope it wont be a blend of data :)

Thank you all,
Best regards,
OP (Company: LERICA) #3880922
Rate this post
useful
not useful
Lothar Miller wrote:
> And what do you do with that segmented value afterwards?
>
> My way would be to use a unsigned(63 downto 0) vector and the
> numeric_std for the calculations with it...

Actually I reduced the size of register at 32bits and I changed the way 
in which the data are presented in my program so that it goes with the 
32bits, since anyway I can't go beyond.

concerning the function unsigned, I don't use it because before storing 
the value in the register I use an absolute value like this:
abs (to_integer (signed (data)))
thank you again for the time you spent to write me,

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now