Hope this helps.
Jim
"Yi-Ran Wang" <ianw...@sbcglobal.net> wrote in message
news:ndWK7.285$564.21...@newssvr21.news.prodigy.com...
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.
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>...
> --