Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

Function to_unsigned

Hello,

I've got some problem to use the function to_unsigned.

I create a program that take two inputs from switch, convert into 7 segment display and show on it.

Then i start a process in which i want to sum each input and show the result on 7 segment.

but when i use the function to_unsigned on this part of code i've got an error


temp <= input1+input2;
result <=to_unsigned(integer(temp));
segmentsR <= unsigned_to_seven_segment(value =>unsigned(result), number_of_digits =>2, value_is_bcd =>false);

The error is:

- formal port of parameter "SIZE" must have actual or default value

So i see on the ieee library what SIZE means and i saw that after ARG is necessary to write, SIZE .......

I try to modify the code in this way


result <= to_unsigned(integer(temp, SIZE:NATURAL));

Now the error is near text ":"; expecting ")" , or ","

What means? Is there anyone can explain me what is SIZE?

Thanks

MAT

11 Replies