Show solutionHide solution
Question 10
A short interval hidden inside a wrapping counter
A free-running counter cycles through integers 0 to , then returns to zero. It increments at an exactly calibrated rate . Start and stop channels capture its value as 65000 and 4464, respectively.
Diagram shown in the original SVG worksheet.
The following model information is supplied:
An initial independent bound says the elapsed time between captures is positive and less than .
A later, stronger bound reduces that limit to .
The start channel captures after its physical event; the stop channel captures after its physical event. Both delays are exact.
For an unwrapped integer count difference , the true capture interval lies in the conservative bound . This represents unresolved fractional ticks at the two captures; there are no other errors.
Use and .
Find every unwrapped count difference compatible with the first time bound. Explain why the smallest nonnegative modular difference is not automatically the unique answer.
Use the stronger bound to select . Find the central estimate of the physical event interval, correcting for both the calibrated tick rate and the unequal channel delays.
Find the full allowed event-interval bound. Assess a firmware report of exactly obtained using a nominal ticks per second and ignoring channel delays and fractional ticks.
Question 10 - Solution
A short interval hidden inside a wrapping counter
Diagram shown in the original SVG worksheet.
(a) Enumerate the possible additional cycles.
The smallest nonnegative modular difference is counts. Every candidate is For the less-than-100-ms bound, are possible: their central capture intervals are approximately 4.999 ms and 70.522 ms. The next candidate, 136072, gives about 136.045 ms and is excluded even allowing one tick at each interval endpoint as specified. A small modular difference does not reveal how many full counter cycles elapsed.
(b) Resolve rollover before correcting the event interval.
The less-than-20-ms bound selects . The central capture interval is The stop capture is delayed 6 microseconds more than the start capture. Thus capture time exceeds physical event time by that amount:
(c) Retain the unresolved fractional ticks.
The exact model interval is Its endpoints are approximately and ; the exact expressions define the bound. The half-width is .
The firmware’s 5.000 ms lies outside this allowed interval. It ignores the calibrated rate, omits the unequal-latency correction, and treats integer capture values as exact event times. Rollover arithmetic alone repairs none of those three errors.