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.

j-bit clock-deviding counter(vhdl,FPGA)

Status
Not open for further replies.

starcoss

Newbie level 1
Joined
Nov 12, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
hello everyone,

i'm a new in vhdl , i want if someone can tell what is a "j-bit clock-deviding counter" (i think that it can be j-frequency devider f/j ??? ), and if someone can give me a code in vhdl?

thank you in advance

regards,
 

I will not write all the code for you, just a small snippet but from my understand it seems like you are trying to divide a clock using a counter. This would work as follows:

If you want to divide the clock by four for example you would use a signal that could count to 4 and use a comparator to drive an output clock.


process( clk )
begin
if rising_edge( clk ) then
if reset = '1' then
-- Reset the counter
counter <= (others=>'0');
elsif counter = "100" then
-- Reset the counter
counter <= (others=>'0');
else
-- Increment the counter
counter <= counter + '1';
end if;
end if;
end process;

You can either put the output clock within the process or use combinatorial logic. Up to you to decide/figure out what is necessary.

Combinatorial example:
output_clk <= '1' when counter = "100" else
'0';
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top