ikevin
Newbie level 5
Hi,
I have a 2-tap FIR filter module as shown below. However, Xilinx kept complaining
The lines that have error are shown in BOLD
EDITED: added comma.
I have a 2-tap FIR filter module as shown below. However, Xilinx kept complaining
ERROR:HDLCompilers:26 - "filter_fir.v" line 6 expecting ')', found '['
ERROR:HDLCompilers:26 - "filter_fir..v" line 7 expecting ')', found '['
The lines that have error are shown in BOLD
module fir_filter (
input reset_b_in,
input system_clock_in,
input [15:0] signal_in,
output [15:0] signal_out,
input [15:0] weight_in [1:0],
output [15:0] weight_out [1:0]
);
reg [15:0] signal_in_after_tap1;
reg [31:0] sum;
assign weight_out = weight_in;
assign signal_out = sum[31:16]; // trucate the least significant 16-bits
always @ (posedge system_clock_in)
begin
if (~reset_b_in)
begin
sum <= 0;
end
else
begin
signal_in_after_tap1 <= signal_in;
sum <= weight_in[0]*signal_in + weight_in[1]*signal_in_after_tap1; // 32 bits
end
end
endmodule
EDITED: added comma.