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.

help on generating a clock

Status
Not open for further replies.

kyjackchan

Junior Member level 3
Joined
Aug 12, 2004
Messages
25
Helped
9
Reputation
18
Reaction score
5
Trophy points
1,283
Activity points
228
hi there, i am very new to verilog. I am simply writing a clock generator code

The behavioural simulation seems to be ok with clk_output signal giving a clock, but all i could see from the oscilloscope is a high signal for pin 'clk_output', is there anything i'm missing here?

Code:
module test(clk_output);
	 output reg clk_output;

	initial
		clk_output = 0;

	always
      #10000000 clk_output = ~clk_output;

endmodule
 

u cannot generate a clock inside an FPGA.
ur piece of code cannot be synthesised.
did u check ur synthesis rpt.
it wud have given u a warning telling u abt the removal of those unsynthesised signals.
there won't b any problems with the Behavioral simulation.
 

this is a common misunderstanding in beginners that if you make a clock in simulation you wont need to have a real world clock in your circuit.

in simulation its okay, the clock will be generated. but in a real world implementation you have to have an external clock source connected to some pin of your device.

i hope that helps
 

your code can't be synthesized.

only a simulation model.

best regards



kyjackchan said:
hi there, i am very new to verilog. I am simply writing a clock generator code

The behavioural simulation seems to be ok with clk_output signal giving a clock, but all i could see from the oscilloscope is a high signal for pin 'clk_output', is there anything i'm missing here?

Code:
module test(clk_output);
	 output reg clk_output;

	initial
		clk_output = 0;

	always
      #10000000 clk_output = ~clk_output;

endmodule
 

there are many methods to output clock. you can try the method of division of system clock. maybe it can match your need.
 

freeinthewind said:
there are many methods to output clock. you can try the method of division of system clock. maybe it can match your need.

but even in that case you need a clock "source" from which to divide the clock. so no matter what, you need an external oscillator (its better to use a programmable osc if you need to do experimentation) to drive the logic inside your device.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top