功能:根据系统时钟50M产生一个1MHZ的频率
描述:定义一个计数器为50M/1M/2,变量clk_1M遇到计数器为50M/1M/2时反转即可。
//产生1M频率
module freq_division_ou(
input wire sclk ,
input wire rst_n ,
output reg clk_ou
);
/*
//计数器分区间产生
parameter max = 50 ;
reg [5:0] cnt ;
always@(posedge sclk or negedge rst_n)
if(!rst_n)
cnt <= 0 ;
else if(cnt==max-1)
cnt <=

最低0.47元/天 解锁文章
2429

被折叠的 条评论
为什么被折叠?



