Forum Discussion
Altera_Forum
Honored Contributor
9 years agoExpression has 32 elements ; expected 16
Hi evryone ! Plz help I have some problems in my modul, i get errors in : Line 71: Expression has 32 elements ; expected 16 ...
Altera_Forum
Honored Contributor
9 years agoPresumed you are using numeric_std library, the both errors can be fixed by writing:
shift_p <= shift_left(shift_p,1);
-- or
shift_p <= resize(2*shift_left,MEM_WIDTH);
wr <= resize(curr_depth_bufbuf, MEM_WIDTH); In the first case, you have the problem, that the bit width of unsigned multiply increases the bit width. Resize cuts the additional bits on the left, necessary to assign the result to signal with fixed bit width. Similarly curr_depth_bufbuf must be zero filled on the left, resize can also do it. There are many other ways to achieve the same.