FIR_Filter
//Owner: Abdul Rehman //Contact:
[email protected] //Please mention reference if this code is used anywhere //Assuming 8bit values for the Lab 11 Q8.0 format and coff Q0.4 format //order must be greater than 2 module FIR_filter#(parameter FIR_filter#(parameter obits_m=8,obits_f=0,dbits_m=8,dbits_f=0,coffbits_m=0,coffbits_f=4,order=4) (output [obits_m+obits_f-1:0] result, input [dbits_m+dbits_f-1:0] xn, input [coffbits_m+coffbits_f-1:0] fil_coff, input set_coff,clk,rst_n); reg [coffbits_m+coffbits_f-1:0] coff[0:order-1]; reg [dbits_m+dbits_f-1:0] xd[0:order-1]; wire [obits_m+obits_f-1:0] ans[0:order-1]; //setting up the string of coff and xns integer i; always@(posedge clk or negedge rst_n)begin if(!rst_n)begin for(i=1;i
Page 1