Forum Discussion

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

Problem with length of register in multiplication op

Hello,

I'm working on a design which contains the following lines,

signal acc : unsigned (7 downto 0) ;

.........

..

process ()

....

if(i /= 7) then

acc <= acc * acc;

i <= i + 1;

.....

I am aware that in the above code, at each counter value the value of the acc is being doubled and is mismatching with the declared accumulator length and the compiler throws an error of mismatch. Is there any other way of getting through this type of situation ?

Thanks

Siva

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I think I found where I was doing mistake folks, actually its pretty basic

    declaring the accumulator length according to the counters maximum value and lodading,storing the multiplication values in particular lengths solved the problem, time for me to revise my basics.

    Siva