From a02a763139e0c1d87c3e5bb06ccc98eff3ec4f72 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Fri, 7 Apr 2017 16:47:26 +0200 Subject: [PATCH] axi_adc_decimate: Do proper sign extension in bypass mode The output data of the decimation block is 16-bit signed. Properly sign extend the 12-bit input signal when the filter is bypassed. Signed-off-by: Lars-Peter Clausen --- library/axi_adc_decimate/axi_adc_decimate_filter.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/axi_adc_decimate/axi_adc_decimate_filter.v b/library/axi_adc_decimate/axi_adc_decimate_filter.v index ff7ef2245..12d474db2 100644 --- a/library/axi_adc_decimate/axi_adc_decimate_filter.v +++ b/library/axi_adc_decimate/axi_adc_decimate_filter.v @@ -124,7 +124,7 @@ module axi_adc_decimate_filter ( always @(*) begin case (filter_enable[0]) - 1'b0: adc_dec_data_a = adc_data_a; + 1'b0: adc_dec_data_a = {{4{adc_data_a[11]}},adc_data_a}; default: adc_dec_data_a = {adc_fir_data_a[25], adc_fir_data_a[25:11]}; endcase @@ -134,7 +134,7 @@ module axi_adc_decimate_filter ( endcase case (filter_enable[0]) - 1'b0: adc_dec_data_b = adc_data_b; + 1'b0: adc_dec_data_b = {{4{adc_data_b[11]}},adc_data_b}; default adc_dec_data_b = {adc_fir_data_b[25], adc_fir_data_b[25:11]}; endcase