--- Quote Start ---
Ok so you get wrong zero after every output.
Your coding is too much for such a simple task and I don't see any feedback to adder. In fact adder(1) seems undriven.
May be the best way is to see following code to implement what you do (basically an accumulator):
process
begin
wait until clk = '1';
y_d <= adder_output & '0'; -- delay stage and multiply by 2 using shift
end process;
...outside clocked process, y_d is fedback as input to adder
adder_output = xin + y_d;
you will need to look after type and size issues
--- Quote End ---
thank you for your reply.
yes, i have stuctured my code for a filter with 3 coeff b (moving average) and 2 coeff a (autoreg)...
so the register adder(1) should contain the result of the previous stage.. see figure transposed structure..
But the goal is realized a filter with more one stage so.. i use array! but in this case only the first element
it is only a simple example..y(k)=x(k)+2y(k-1) but with real coefficient i can't use the structure
y_d <= adder_output & '0';
because the coeff.. it's for example 281 so i must use lpm.moltiplicator with input std_logic_vector
and i provide coefficient serialy with a structure show in my program iir_1.txt
One advantage of transpose structure is that we don't use to sum the products at the end , but the sums is realized step by step
using the structure recorsive adder(i)=num(i)+den(i)+adder(i+1)...
So i can rewrite my core code here... for the first order filter
...
sop: PROCESS(CLK) --- PROCESS for the sum of product
BEGIN
IF clk'event and (clk='1') then
adder<=pnum+pden; -- sum the result for every stage.. valide only for first filter type
y<=adder;
end PROCESS
sop;
-- ISTANTIATE L PIPELINED MULTIPLIER NUM
MulGen: FOR I IN 0 TO L-1 GENERATE
Mulsnum: lpm_mult --Moltiplication pnum(i)=c(i)*x
...
PORT MAP ( dataa=>x, datab=>c(I), result =>pnum(I)); -- with first order i don't use cycle but only pnum(0)
END GENERATE;
-- ISTANTIATE L PIPELINED MULTIPLIER DENUM
MulGen2: FOR K IN 0 TO L-2 GENERATE --Moltiplication pden(i)=a(i)*y(i))
Mulsden: lpm_mult
....
PORT MAP ( dataa=>a(K), datab=>y, result =>pden(K)); -- with first order i don't use cycle but only pden(0)
END GENERATE;
y_out<=adder;
END architecture;
Thank you for your interest in my problem but if the problem is only resolve y(k)= x(k)+2y(k-1)
i have just resolved it using direct form.. that is more simple than transposed but haven't some advantage.:(
Have you other ideas?
in this moment i think that delay the first part is the only solution.. but i haven't realized it correctly..:evil:
thank you!
by Enrico:o