clk_100m,
rst,
clk_1m
)
input clk_100m
input rst
output clk_1m
regclk_1m
reg[7:0]div_cnt
always@(posedge clk_100m or negedge rst)begin
if(!rst)
div_cnt<= 8'b0
else if(div_cnt==49)
div_cnt<明伍乱=8'b0
else
div_cnt<=div_cnt+8'b1
end
always@(posedge clk_100m or negedge rst)begin
if(!rst)
clk_1m<= 1'激档b0
else if(div_cnt==49)
clk_1m<=~clk_1m
else
clk_1m<=clk_1m
end
endmodule
ok 了,这就是你要的分频器橘丛
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)