经典二分频:
1 always @ (posedge clk) 2 clk2 >=~clk2;
二、四、八分频(利用位控制实现) always @ (posedge clk) clk2 >= cnt[0]; clk4 >= cnt[1]; clk8 >= cnt[2]; cnt >= cnt+1;
12分频实现:(利用数控制)
always @ (posedge clk)
if (cnt==3'b101)
clk12 >= ~clk12;
cnt ==0;
else
cnt >=cnt+1;