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.

range of the counter needed depending on the clk frequency

Status
Not open for further replies.

BooM

Member level 4
Joined
Aug 30, 2007
Messages
73
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,288
Activity points
1,687
Hi all,

I need the function which can give me the range of a counder depending on the clk frequency.
For example: if my clk is 50Mhz and i want to create 2 sec delay, how can I find the range of the counter which is needing to keep 2 sec delay?


Thank you in advance!!!
B.
 

I'm not sure what you mean by "the function", but you'll need a counter with at least 100 million states (50 MHz times 2 seconds).
A 27-bit binary counter would be sufficient. It can count up to 2^27 states, about 134 million.
 

Re: range of the counter needed depending on the clk frequen

A formula (equation) perhaps?

1 Hz = one cycle per second
1 MHz = one million cycles per second

period = 1 / frequency
count = delay / period
bits required = ceil ( log2 count )

ceil is round up (toward +infinity)

for example:

log2 (32) = 5 (exact)
log2 (33) = 5.xxxx, so round up to 6 bits required
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top