Attention
This documentation is a work in progress. Expect to see errors and unfinished things.
iq_double_inte Source File
1`timescale 1ns / 1ns
2
3// Double-integrator for interleaved I-Q samples
4// Front end of a second-order CIC, see iq_chain4
5
6module iq_double_inte #(
7 parameter dwi=16, // data width in
8 parameter dwo=28 // data width out
9) (
10 input clk, // timespec 8.4 ns
11 input signed [dwi-1:0] in, // IQ muxed
12 output signed [dwo-1:0] out
13);
14
15reg signed [dwo-1:0] int1=0, int1_d=0, int2=0, int2_d=0;
16always @(posedge clk) begin
17 int1 <= int1_d + in; // Add to the delayed sample
18 int1_d <= int1; // Delay
19 int2 <= int2_d + int1; // Second addition to further delayed sample
20 int2_d <= int2; // Delay
21end
22assign out = int2;
23
24endmodule