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.

VHDL: Help me generate a 1hz clock cycle

Status
Not open for further replies.

karansinghdx

Newbie level 3
Joined
Apr 9, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,337
Can anyone provide me code to generate a 1hz frequency clock generator from vhdl with clock cycle of 100Mhz default. please.
 

Code:
entity digi_clk is
port (clk1 : in std_logic;
       clk : out std_logic
     );
end digi_clk;

architecture Behavioral of digi_clk is

signal count : integer :=1;
signal clk : std_logic :='0';


 --clk generation.For 100 MHz clock this generates 1 Hz clock.
process(clk1) 
begin
if(clk1'event and clk1='1') then
count <=count+1;
if(count = 50000000) then
clk <= not clk;
count <=1;
end if;
end if;
end process;


Taken from https://vhdlguru.blogspot.com/
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top