UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Participant kp1998_
Participant
142 Views
Registered: ‎06-11-2019

lowpass and highpass filter code

Jump to solution

Highpass filter code - 

module hpf_l3(clk,rst,in,dataout);
input [31:0]in;
input clk,rst;
output [63:0]dataout;
wire [63:0]d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d_11,d_12,d_13,d_14;
wire [63:0]m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16;
wire [63:0]d11,d12,d13,d14,d15,d16,d17,d18,d19,d20,d21,d22,d23,d24,d25;
parameter h0=724;
parameter h1=0;
parameter h2=0;
parameter h3=0;
parameter h4=0;
parameter h5=0;
parameter h6=0;
parameter h7=0;
parameter h8=-724;
parameter h9=0;
parameter h10=0;
parameter h11=0;
parameter h12=0;
parameter h13=0;
parameter h14=0;
parameter h15=0;
assign m1=x*h0;
d_ff z5(clk,rst,x,d11);//1
assign m2=d11*h1;
assign d1=m1+m2;
d_ff z6(clk,rst,d11,d12);//2
assign m3=d12*h2;
assign d2=d1+m3;
d_ff z7(clk,rst,d12,d13);//3
assign m4=d13*h3;
assign d3=d2+m4;
d_ff z8(clk,rst,d13,d14);//4
assign m5=d14*h4;
assign d4=d3+m5;
d_ff z9(clk,rst,d14,d15);//5
assign m6=d15*h5;
assign d5=d4+m6;
d_ff z10(clk,rst,d15,d16);//6
assign m7=d16*h6;
assign d6=d5+m7;
d_ff z11(clk,rst,d16,d17);//7
assign m8=d17*h7;
assign d7=d6+m8;
d_ff z12(clk,rst,d17,d18);//8
assign m9=d18*h8;
assign d8=d7+m9;
d_ff z13(clk,rst,d18,d19);//9
assign m10=d19*h9;
assign d9=d8+m10;
d_ff z14(clk,rst,d19,d20);//10
assign m11=d20*h10;
assign d10=d9+m11;
d_ff z15(clk,rst,d20,d21);//11
assign m12=d21*h11;
assign d_11=d10+m12;
d_ff z16(clk,rst,d21,d22);//12
assign m13=d22*h12;
assign d_12=d_11+m13;
d_ff z17(clk,rst,d22,d23);//13
assign m14=d23*h13;
assign d_13=d_12+m14;
d_ff z18(clk,rst,d23,d24);//14
assign m15=d24*h14;
assign d_14=d_13+m15;
d_ff z19(clk,rst,d24,d25);//15
assign m16=d25*h15;
assign dataout=d_14+m16;
endmodule

lowpass filter code - 

module lpf_l3(clk,rst,x,dataout);
input [31:0]x;
input clk,rst;
output [63:0]dataout;
wire [63:0]d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d_11,d_12,d_13,d_14;
wire [63:0]m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16;
wire [63:0]d11,d12,d13,d14,d15,d16,d17,d18,d19,d20,d21,d22,d23,d24,d25;
parameter h0=724;
parameter h1=0;
parameter h2=0;
parameter h3=0;
parameter h4=0;
parameter h5=0;
parameter h6=0;
parameter h7=0;
parameter h8=724;
parameter h9=0;
parameter h10=0;
parameter h11=0;
parameter h12=0;
parameter h13=0;
parameter h14=0;
parameter h15=0;
assign m1=x*h0;
d_ff u5(clk,rst,x,d11);//1
assign m2=d11*h1;
assign d1=m1+m2;
d_ff u6(clk,rst,d11,d12);//2
assign m3=d12*h2;
assign d2=d1+m3;
d_ff u7(clk,rst,d12,d13);//3
assign m4=d13*h3;
assign d3=d2+m4;
d_ff u8(clk,rst,d13,d14);//4
assign m5=d14*h4;
assign d4=d3+m5;
d_ff u9(clk,rst,d14,d15);//5
assign m6=d15*h5;
assign d5=d4+m6;
d_ff u10(clk,rst,d15,d16);//6
assign m7=d16*h6;
assign d6=d5+m7;
d_ff u11(clk,rst,d16,d17);//7
assign m8=d17*h7;
assign d7=d6+m8;
d_ff u12(clk,rst,d17,d18);//8
assign m9=d18*h8;
assign d8=d7+m9;
d_ff u13(clk,rst,d18,d19);//9
assign m10=d19*h9;
assign d9=d8+m10;
d_ff u14(clk,rst,d19,d20);//10
assign m11=d20*h10;
assign d10=d9+m11;
d_ff u15(clk,rst,d20,d21);//11
assign m12=d21*h11;
assign d_11=d10+m12;
d_ff u16(clk,rst,d21,d22);//12
assign m13=d22*h12;
assign d_12=d_11+m13;
d_ff u17(clk,rst,d22,d23);//13
assign m14=d23*h13;
assign d_13=d_12+m14;
d_ff u18(clk,rst,d23,d24);//14
assign m15=d24*h14;
assign d_14=d_13+m15;
d_ff u19(clk,rst,d24,d25);//15
assign m16=d25*h15;
assign dataout=d_14+m16;
endmodule

Hello

the abovr codes of lowpass and highpass filters are not working, not getting any output for both the codes.Can someone check and let me know if the code is correct or wrong, and what could the reason for not getting output.

Waiting for the response at the earliest.

Thank you

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
109 Views
Registered: ‎04-24-2013

Re: lowpass and highpass filter code

Jump to solution

Hi @kp1998_ ,

You don't have any input to your system, you have:

assign m1=x*h0;
d_ff z5(clk,rst,x,d11);//1

But x is never defined.

Add the file to a project and Open Elaborated Design to view what structure the RTL is defining.

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
0 Kudos
3 Replies
Moderator
Moderator
130 Views
Registered: ‎04-24-2013

Re: lowpass and highpass filter code

Jump to solution

Hi @kp1998_ ,

You are missing Module <d_ff> e.g.

ERROR: [VRFC 10-2063] Module <d_ff> not found while processing module instance <z5>

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
0 Kudos
Participant kp1998_
Participant
126 Views
Registered: ‎06-11-2019

Re: lowpass and highpass filter code

Jump to solution

I have written d_ff module...forgot to attach it.

0 Kudos
Moderator
Moderator
110 Views
Registered: ‎04-24-2013

Re: lowpass and highpass filter code

Jump to solution

Hi @kp1998_ ,

You don't have any input to your system, you have:

assign m1=x*h0;
d_ff z5(clk,rst,x,d11);//1

But x is never defined.

Add the file to a project and Open Elaborated Design to view what structure the RTL is defining.

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
0 Kudos