/* This file is part of JT12.
JT12 program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
JT12 program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JT12. If not, see .
Author: Jose Tejada Gomez. Twitter: @topapate
Version: 1.0
Date: 10-12-2018
*/
module jt12_interpol #(parameter calcw=18, inw=16,
n=2, // number of stages
m=1, // depth of comb filter
rate=2 // it will stuff with as many as (rate-1) zeros
)(
input rst,
input clk,
(* direct_enable *) input cen_in,
(* direct_enable *) input cen_out,
input signed [inw-1:0] snd_in,
output reg signed [inw-1:0] snd_out
);
reg signed [calcw-1:0] inter6;
wire signed [calcw-1:0] comb_op, integ_op;
localparam wdiff = calcw - inw;
generate
genvar k;
wire [calcw-1:0] comb_data[0:n];
assign comb_data[0] = { {wdiff{snd_in[inw-1]}}, snd_in };
assign comb_op = comb_data[n];
for(k=0;k