To generate clock using counter logic

Hi,

Need to generate clock using counter logic inside forever-begin
This is to get a simple way to generate.
Or else’
if we use this way,

initial begin
   my_clk = 0;
   forever begin
      #1ns; //1 GHz
      my_clk = ~my_clk;
   end
end

Everytime we need to change delay value.Is there a way to generate using counter so that initially we can give a 16 bit value then by count= count +1 it goes on incrementing.

Kindly provide solution ASAP

In reply to christin kripa John:

Simply implement your counter in the initial block. There is no limitatio

In reply to chr_sue:

can u please provide the code

In reply to christin kripa John:

To be honest you do not solve your problem with the delay or you have a reference clock for triggering your counter. Do you have?

In reply to christin kripa John:

You need more explanations. “Everytime we need to change delay value” Everytime relative to what? A counter needs a clock, then you can use the output of the counter to generate another clock.

In reply to christin kripa John:

Hi,

Hope this will work.

initial 
   begin
    bit [3:0]i;
    for(i=0; i<16; i++)
      begin
        #1 clk = ~clk;
      end
   end

Thanks