[SOLVED] Hz vs number of bits

Status
Not open for further replies.

tahirsengine

Member level 3
Joined
May 7, 2007
Messages
66
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Germany
Activity points
1,929
My question is very elementary, yet tricky.

Say for example: I have a digital clock of 10MHz. I need to trigger an operation at 10ms.

So how many bits I will be needing, after counting which I will be at 10ms? (Number of bits in counter).

Please elaborate a little.

Thanks in advance.

- - - Updated - - -

Ok got answer. Sharing it for general info here.

For 10MHz, the time period for one cycle is 0.00000001 second. For counting a time of 10ms, we will divide 10m by .00000001. This will give us a count of 100000. So, we will count 100000 with a clock, that has a single cycle of .00000001 seconds in order to reach 10ms timings. So in order to count 100000 we need 17 bits(*11000011010100000‬).

Thanks anyway
 

Glad you enjoyed having a conversation with yourself, but there’s an easier way:

10E-3*10E6=100E3

Log(100E3) /log(2)=>17
 
Glad you enjoyed having a conversation with yourself, but there’s an easier way:

10E-3*10E6=100E3

Log(100E3) /log(2)=>17

My method is indeed difficult, but explains everything.
 

Glad you enjoyed having a conversation with yourself, but there’s an easier way:

10E-3*10E6=100E3

Log(100E3) /log(2)=>17

don't you need just 16 bits? since you only need to count to 100E3/2, toggle clk, count 100E3/2 again and toggle?
 

Hi,

don't you need just 16 bits? since you only need to count to 100E3/2, toggle clk, count 100E3/2 again and toggle?
Correct. For the counting.
But you need an extra bit (flip flop) for the "toggle".

Klaus
 

    V

    Points: 2
    Helpful Answer Positive Rating
Hi,


Correct. For the counting.
But you need an extra bit (flip flop) for the "toggle".

Klaus

Isn't it possible to add combi logic to represent a toggle enable?
 

Hi,

Yes, for "toggle enable"....but this is just a signal as input to the toggle flipflop.

Klaus
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…