unsigned to integer conversion

J

john

Hello,

i have a 48 bit unisgned numbers and need to convert them to integer.
I used to_integer functioin but getting the eroor that this function
only works with numbers less than 32 bit. can anyone suggest another
function or technique.

John
 
B

Ben Jones

john said:
Hello,

i have a 48 bit unisgned numbers and need to convert them to integer.
I used to_integer functioin but getting the eroor that this function
only works with numbers less than 32 bit. can anyone suggest another
function or technique.

An integer in VHDL is only 32 bits wide. In fact, it's not even that wide,
since the most-negative value (-2**31) is not part of the defined range for
integers.

If you need to manipulate numbers that are wider than 31 bits, you cannot
use VHDL's built-in integer type. Sorry.

-Ben-
 
N

Nicolas Matringe

Ben Jones a écrit :
An integer in VHDL is only 32 bits wide. In fact, it's not even that wide,
since the most-negative value (-2**31) is not part of the defined range for
integers.

If you need to manipulate numbers that are wider than 31 bits, you cannot
use VHDL's built-in integer type. Sorry.

You could try by splitting your unsigned vector and converting each
slice to integer. You'll probably need to define an array of integers
type to keep your slices together in a single object (signal or variable)
I did it once for a 96 bits wide memory model (storing integers is less
memory consuming than storing vectors)

Nicolas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top