为什么我在clk_out上不关心?
我将x作为 clk_out 。示例频率分隔线。
module freq_by2(input clk,rst,output reg clk_out);
always @(posedge clk)
begin
if (rst==1'b1)
begin
clk_out<=0;
end
else
begin
clk_out<=~clk_out;
end
end
endmodule
module freq_by4(input clk,rst,output reg [1:0] clk_out);
freq_by2 f0(.clk(clk),.rst(rst),.clk_out(clk_out[0]));
freq_by2 f1(.clk(clk_out[0]),.rst(rst),.clk_out(clk_out[1]));
endmodule
I am getting X as clk_out.Example of the frequency divider.
module freq_by2(input clk,rst,output reg clk_out);
always @(posedge clk)
begin
if (rst==1'b1)
begin
clk_out<=0;
end
else
begin
clk_out<=~clk_out;
end
end
endmodule
module freq_by4(input clk,rst,output reg [1:0] clk_out);
freq_by2 f0(.clk(clk),.rst(rst),.clk_out(clk_out[0]));
freq_by2 f1(.clk(clk_out[0]),.rst(rst),.clk_out(clk_out[1]));
endmodule
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确定,您正在生成正确的同步
rst
脉冲吗?也就是说,与clk和clk/2同步,因为您的f1
实例化与clk_out
输出f0
的输出同步?否则,您将否定clk_out
freq_by2 内的最后一个值,该值最初是x
,除非生成正确的重置。Are you sure, you are generating a correct, synchronous
rst
pulse? That is, synchronous to both clk and clk/2, because yourf1
instantiation is synchronous to theclk_out
output off0
? Otherwise, you are negating the last value ofclk_out
inside offreq_by2
, which isX
initially, unless a correct reset was generated.