A
Adrian Spilca
Guest
Is there a way to describe a N-input Adder?
I mean just behaviour, no use of lib components?
I couldn't think of any other way of describing the operation but
sum = sum + op(i)
In other words, here is what I have in mind but this obviously doesn't work
(don't be bothered by the sintax)
signal op is array (0 to N) of signed (..)
NinAdd: process (reset, op)
begin
if (reset = '0') then
sum <= (others => '0');
else
for i in 0 to N loop
sum <= sum + op(i);
end loop;
end if;
end process NinAdd;
I tried "for .. generate" which is more appropriate being a concurrent
statement but then I don't know how to initialise the sum (reset signal).
Regards,
Adrian
I mean just behaviour, no use of lib components?
I couldn't think of any other way of describing the operation but
sum = sum + op(i)
In other words, here is what I have in mind but this obviously doesn't work
(don't be bothered by the sintax)
signal op is array (0 to N) of signed (..)
NinAdd: process (reset, op)
begin
if (reset = '0') then
sum <= (others => '0');
else
for i in 0 to N loop
sum <= sum + op(i);
end loop;
end if;
end process NinAdd;
I tried "for .. generate" which is more appropriate being a concurrent
statement but then I don't know how to initialise the sum (reset signal).
Regards,
Adrian