题解 #无占空比要求的奇数分频#
无占空比要去的奇数分频
http://www.nowcoder.com/practice/12d0615157a04e43bb7f41debc3cfa5b
`timescale 1ns/1ns
module odd_div (
input wire rst ,
input wire clk_in,
output wire clk_out5
);
//**code//
reg [2:0]cnt;
always@(posedge clk_in or negedge rst)
begin
if(~rst)
begin
cnt<=0;
end
else
if(cnt==5)
cnt<=1;
else
cnt<=cnt+1;
end
assign clk_out5=(cnt==1|cnt==2)?1:0;
//**code// endmodule