frequency divider by 2,3

Joined
Oct 15, 2006
Messages
1
Reaction score
0
frequency divider by 2,3 with duty cycle 50%

pls anyone can help me verilog code for frequency divider by 2,3 with duty cycle 50%~~~ thx a lot

following verilog code is just for 2,4. I don't know how to do for frequency divider by 3. PLs help me~~ thx again


module freqdiv(q,Clk,Reset,i);

input Clk,Reset;
output q;
output i;

reg i;
reg q;
always @(posedge Reset or posedge Clk)
begin
if(Reset)
begin
q= 0;
i = 0;
end
else
begin
i =(q==1)? ~i : i ;
q = q +1;
end
end
endmodule
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top