我的疑问
时间:10-02
整理:3721RD
点击:
下面程序当中CNT的初值是多少呢?
module div248(div2,div4,div8,clk);
output div2,div4,div8 ; //分频输出
input clk;
reg div2,div4,div8;
reg [2:0]cnt;
always @ (posedge clk)
begin
cnt<=cnt+1; //为什么?cnt初值是?
div2<=cnt[0]; //?如果是这样的话,div=2(CNT=0)?
div4<=cnt[1];
div8<=cnt[2];
end
endmodule
module div248(div2,div4,div8,clk);
output div2,div4,div8 ; //分频输出
input clk;
reg div2,div4,div8;
reg [2:0]cnt;
always @ (posedge clk)
begin
cnt<=cnt+1; //为什么?cnt初值是?
div2<=cnt[0]; //?如果是这样的话,div=2(CNT=0)?
div4<=cnt[1];
div8<=cnt[2];
end
endmodule
agree with you!