发布网友 发布时间:2022-04-24 12:31
共1个回答
热心网友 时间:2022-05-03 08:06
做个counter,数到一定数值时输出1追问能麻烦你写一个输入频率为30M~40Mhz,输出频率为4M~8Mhz的分频器Verilog代码吗?急求!!谢谢了!追答mole fredivider(clk,rst,clk_out);
input clk,rst;
output reg clk_out;
reg [31:0] counter;
always @(posedege clk or negedge rst)
begin
if(!rst)
begin
counter<=32'd0;
clk_out <= 1'b0;
end
else
if(counter==32'd25000) // 25000 换成 (1/f_out)/(1/f_in)/2
begin
counter<=32'd0;
clk_out <= ~clk_out;
end
else
begin
counter<=counter+1;
end
end
endmole