Why does following program shows error Q and D are not declared?
<p>I wrote this program for an FIR filter and used D flip flop for delay. I needed to implement filter with Impulse response h(n) = {1, -1} </p>

<p>Despite various efforts, it shows the same error that D and Q aren't defined/ declared properly. There was another error saying Q has been illegally redeclared, for that, I deleted the line where I defined Q output register, in the second module. Please point out to the error and tell me how to fix it.</p>

<pre><code>module firfilter( dout, din, clock); 
input din, clock;
output dout; 

parameter b0 = 1'd1; 
parameter b1 = 1'd1;

assign dout = b0 - b1 * Q;

always@ (posedge clock) 

        D &lt; = din; 

endmodule

module dff ( D, clock, Q); 
input D, clock; 
output Q; 


always@ (posedge clock) 

       Q &lt;=  #(1) D; 

endmodule
</code></pre>