Forum Discussion
Altera_Forum
Honored Contributor
12 years agoI also it is wrong><
actually this is the interface of my fir filter code. Here's my fir filter verilog.. module toplvl (x,selA,clk,ld,rst,Q); input [7:0]x; input [2:0] selA; input clk,ld,rst; output [15:0] Q; wire [7:0] s1; wire [15:0] s2,s4; sel1 A1(selA,s1); multiplier A2(x,s1,s2); register A4(clk,ld,rst,s2,Q); endmodule module multiplier(x,b,p); input [7:0] x,b; output [15:0] p; assign p=x*b; endmodule module sel1(selA,b); input [2:0] selA; output [7:0] b; reg [7:0] b; always@* case(selA) 0: b=8'd2; 1: b=8'd4; 2: b=8'd6; 3: b=8'd8; 4: b=8'd10; default: b=8'd0; endcase endmodule module register(clk,ld,rst,p,Q2); input clk,ld,rst; input [15:0] p; output [15:0] Q2; reg [15:0] Q2; always@(posedge clk) if (rst==1) Q2<=p; else if (ld==1) Q2=p+Q2; endmodule after that i hv to create an interface for it... cause I want to load it on DE2 board.