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] Needed help with frequency divider

Status
Not open for further replies.

marcin1135

Newbie level 1
Joined
Mar 29, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
HI all.
I have some problems with frequency divider. I have divider 5MHz -> 2Hz.

Code:
signal CONTENT: std_logic_vector(21 downto 0):= "0000000000000000000000";
begin
process (CLK5MHZ_IN)
begin
if rising_edge(CLK5MHZ_IN) then
if CONTENT(20 downto 0) = "111111111111111111111" then
CONTENT <= not CONTENT(21) & "000000000000000000000";
else CONTENT <= CONTENT + 1;
end if;
end if;
end process;
CLK2HZ_OUT <= CONTENT(21);

I need frequency: 1Hz and 5Hz.
Please help me with this issue. I will be grateful for any sugestions.

regards
Martin:!:
 

In my opinion you can realize it as:
if rising_edge(clk) then CONTENT<=CONTENT+1;
end if;
end processs;
CLK2HZ<=CONTENT(21);
CLK5HZ<=CONTENT(20);
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top