//Direct FIR filter with 4 taps [-1 3.75 3.75 -1] /.out);
module fir_direct (clk, x_in, parameter n=8; parameter 1=4; // filter lenght input clk; input [n-1:0] x_in;
always@(posedge clk)
//The coefficients are [-1 3.75 3.75 /* y.out <= 2 * tap[l] + tap[l] + tap[l] / 2 + tap[l] / 4 + 2 * tap[2] + tap[2] + tap[2] / 2 + tap[2] / 4 - tap[3] - tap[0]; */
output [n-1:0] y.out;
reg signed [n-l:0] tap [1-1:0]; reg signed [n-1:0] y.out; integer i;
/*y.out <= {tap[l][n-2:0],l'b0} + tap[l] +{tap[l][n-l].tap[l][n-l :1 ]} + {tap[l][n-l],tap[l][n-l],tap[l][n-l :2]} + {tap[2][n-2:0],l'b0} + tap[2] + [tap[2][n-l],tap[2][n-l :1]} + {tap[2][n—1 ],tap[2][n—1 ],tap[2][n-l :2]}
- tap[3] - tap[0]; */
y.out <= (tap[l]<<1) + tap[l] + (tap[l]>>> 1) + (tap[l]>>>2) + (tap[2]<<l) + tap[2] + (tap[2]>>>l) + (tap[2]>>>2)
- tap[3] - tap[0]; for(i=l; i<=3; i=i+l)
tap[i] <= tap[i—1 ];
tap[0] <= x_in; endmodule