0
\$\begingroup\$

So let's say I have an incoming signal: 1 clock cycle from a ~1-100 MHz (50 MHz for this example) clock domain. And I want to drive an output that must be active high for 10 seconds for each time the incoming signal is active high.

There is no check needed for multiple pulse from the input.

My only two ideas is to use multiply clock dividers that will stretch the input pulse.

so x ns active high turns to 2x ns active high, 4x ns, 8x ns.... It will take tons of DFF and inverters.

My second idea, is just toggle the output high, count 10 seconds, and de-assert low. If I have a few 16-bit counters, this should take around 120 DFFs. (50 MHz => 20 ns period) So the incoming active high pulse will trigger the output high and start the counter until it hits >10 seconds (does not have to be accurate).

Which one would be a better implementation (in terms of least DFF used)?

\$\endgroup\$
  • \$\begingroup\$ Now that I think about it, I guess it doesn't matter if I have multiple 16-bit counters. I can just have 1x 114-bit counter. \$\endgroup\$ – Cit5 Aug 19 at 23:13
  • \$\begingroup\$ If accuracy is not important why not an analog solution? \$\endgroup\$ – George White Aug 19 at 23:52
  • \$\begingroup\$ what would you do with a 114 bit timer? ... you said that only one pulse comes in \$\endgroup\$ – jsotola Aug 20 at 0:02
  • 1
    \$\begingroup\$ @tony a 5ns trigger pulse might be a bit fast for a 555 \$\endgroup\$ – Jasen Aug 20 at 0:55
  • 1
    \$\begingroup\$ Is there a reason you want a digital (clocked) solution for this, by the way? \$\endgroup\$ – ThreePhaseEel Aug 20 at 1:39
3
\$\begingroup\$

In the digital domain, a counter will be the simplest and most correct approach. Dividing a clock limits you to measuring exact binary multiples of the original clock; a counter can be configured to count up (or down) to any value.

Also, your math is way off. 10 seconds at 50 MHz comes out to 5×108 cycles, which can be counted in just under 29 bits (229 = 5.36×108). 114 DFFs would give you a counter with a period of 4.15×1026 seconds, well beyond the expected lifetime of the universe.

\$\endgroup\$
  • \$\begingroup\$ You are correct. I'm not sure how I got 114-bit either. Thank you \$\endgroup\$ – Cit5 Aug 20 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.