Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- Assuming you mean (n) will vary as "generic" per compile then one way is to declare a a large adder to accommodate max (n) then wire up per compile. e.g. sum <= A(1) + A(2) +A(3) +A(4) +A(5) + A(6) + A(7); -- 7 is max n then for a given compile with n set to 3: for i in 1 to 3 loop A(i) <= a(i); end loop; That way the compiler will optimise off inputs A(4) ~ A(7) --- Quote End --- Thanks a lot! :)