Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to divide a frequncy/Clock by 3

3,225 views
Skip to first unread message

Yi-Ran Wang

unread,
Nov 21, 2001, 5:50:59 PM11/21/01
to
How to divided a frequency or Clock by 3,5,6....10 using Flip flop? I tried
to use counter but I don't know how to stop at 3,5,6...or 10. Please tell me
how to connect them physically. Thanks!


Jim

unread,
Nov 21, 2001, 10:46:01 PM11/21/01
to
Dividing a clock by an even number and getting a 50% duty cycle clock output
is trivial (invert you clock output every time the counter reaches half of
the divider and reset the counter). It is not as easy for odd dividers. But
for the particular ones (3 and 5) you want, Xilinx has an app note showing
how to get 50% duty cycle output with combinatorial logic. Here is the URL
http://www.xilinx.com/xcell/xl33/xl33_30.pdf But if you are using PLL or
DLL, you do not have to do all this.

Hope this helps.
Jim

"Yi-Ran Wang" <ianw...@sbcglobal.net> wrote in message
news:ndWK7.285$564.21...@newssvr21.news.prodigy.com...

Shai Eshet

unread,
Nov 29, 2001, 3:21:20 AM11/29/01
to
here is the implementation in verilog.

module clkdiv3(clk,clkout);
input clk;
output clkout;

reg [1:0] count;
reg       sig1;
reg       sig2;

always @(posedge clk)
 begin
   count <= count + 1;
   if (count == 2)
       count <= 0;
 end

always @(count)
  begin
    if (count == 0)
        sig1 = 1;
    else
        sig1 = 0;
  end

always @(negedge clk)
  begin
    sig2 <= sig1;
  end

assign clkout = sig2 | sig1;
endmodule

-- 
The information in this email, including attachments, is CONFIDENTIAL, and
is provided only to each addressee.  If you are not such an addressee, or an
agent or employee responsible for delivering this email to such addressee:
you have received this email in error; please immediately notify the sender
by replying to this email; delete this email; and any use, dissemination,
distribution, disclosure or copying of this email or information contained
herein, in whole or in part, is strictly prohibited.
 

Illan

unread,
Nov 30, 2001, 6:57:36 PM11/30/01
to
Hi,
you might prefare the following that have less logic on the clock
and thus less sqew from the master clock which in some case might make
effect.

always @ (posedge clk or negedge rstn)
if (~rstn)
sr <= #1 3'b100;
else
sr <= #1 {sr[1:0],sr[2]};

than the clock is any of the bit you choose from sr for example

assign clk_div3 = sr[0];

for higher divider you can than combine the counter with sr of 2 or 3
etc and get the dived clock with reasnbale amount of FF and with good
sqew. (for example if need to devide by 24 make a counter to 12 and sr
of 2 bit)

have a nice day

Illan


Shai Eshet <sh...@silicon-value.com> wrote in message news:<3C05F000...@silicon-value.com>...

> --

0 new messages