module intFilterBlock 
#(	parameter	inOutDataWidth	=	18,
	parameter	filteredDataWidth	=	25
)
(
	input Clk_i,
	input Rst_i,
	input [inOutDataWidth-1:0] Data_i,
	input DataNd_i,
	output [filteredDataWidth-1:0] Data_o,
	output DataValid_o
);


	reg signed [inOutDataWidth-1:0] inReg;
	reg signed [filteredDataWidth-1:0] sumResult;
	reg dataVal;
	
	always	@(posedge	Clk_i)	begin
		if (!Rst_i)	begin
			if (DataNd_i)	begin
				inReg <= Data_i;
			end
		end	else	begin
			inReg	<= 0;
		end
	end
	
	always @ (posedge Clk_i)	begin
		if (!Rst_i)	begin
			if (DataNd_i)	begin
				sumResult <= inReg + sumResult;
				dataVal	<= 1'b1;
			end	else	begin
				sumResult <= 0;
				dataVal <= 0;
			end
		end	else	begin
			sumResult	<=	0;
			dataVal <= 0;
		end
	end

	assign Data_o = sumResult;
	assign DataValid_o = dataVal;

endmodule