小弟初学hdl,编写了一个m序列发生器,可输出的居然是一条直线!!!! 素闻论坛大神众多,恳请大神帮我看看问题出在哪?
文件1:寄存器模块 module zhixu(d,clk,rst,q); input d,clk,rst; output q; reg q; always @(posedge clk) begin if(rst) q<=1; else q<=d; end endmodule 文件2:顶层模块 module DS(clk,rst,pnout); input clk,rst; output pnout; reg feed; reg pnout; wire[6:1]qout; always@(posedge clk) begin pnout<=qout[6]; feed<=qout[1]^qout[6]; end zhixu ul(.d(feed),.clk(clk),.rst(rst),.q(qout[1])); zhixu u2(.d(qout[1]),.clk(clk),.rst(rst),.q(qout[2])); zhixu u3(.d(qout[2]),.clk(clk),.rst(rst),.q(qout[3])); zhixu u4(.d(qout[3]),.clk(clk),.rst(rst),.q(qout[4])); zhixu u5(.d(qout[4]),.clk(clk),.rst(rst),.q(qout[5])); zhixu u6(.d(qout[5]),.clk(clk),.rst(rst),.q(qout[6])); endmodule
|