Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to write verilog code for calculation of clock frequency

Status
Not open for further replies.

vinothkumar41

Newbie level 3
Joined
Jan 28, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
clock_frequency

How to write verilog code for calculation of clock frequency?
 

Re: clock_frequency

Code:
`timescale 1ns/10ps

module foo(clk);
     input clk;

     real t0;
     real t1;
     real frequency;

     initial
          begin
               @ (posedge clk) t0 = $realtime;
               @ (posedge clk) t1 = $realtime;
               frequency = 1.0e9 / (t1 - t0);
               $display("Frequency = %g", frequency);
               $finish;
          end
endmodule
 

Re: clock_frequency

Thanks for clearing my doubt...


reagrds,
vinoth
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top