这个问题已经解决了
谢谢大家啊
module odd_f(rst, clk_in, clk_out);
input rst;
input clk_in;
output clk_out;
reg [1:0] cnt4;
reg clk_en;
reg clk_out;
reg clk_xor;
always @(clk_in or clk_out)
begin
clk_xor=clk_in ^ clk_out;
end
always @(posedge rst or posedge clk_xor)
begin
if(rst)
begin
cnt4<=2'b11;
clk_en<=0;
end
else
begin
cnt4<=cnt4+1;
if(cnt4==2'b11)clk_en<=~clk_en;
else clk_en<=~clk_en;
end
end
always @(posedge rst or posedge clk_en)
begin
if(rst)
clk_out<=0;
else
clk_out<=~clk_out;
end
endmodule