Add one second

Y

Yngve Skogseide

I am working on an application using a GPS receiver to obtain the
absolute time. The GPS transmits the current UTC time and date together
with a synchronization (PPS) pulse every second. The problem is that at
the time the PPS pulse is asserted, the current time is still being
transmitted, and is not known.

A seemingly simple solution is to take the previously received UTC time,
and add one second to this to obtain the current time. Adding one second
is not a trivial task (especially not in a HDL), taking into account
the varying number of days per month, and even leap years. The only
algorithm I can conceive which achieves this involves deeply chained
decision logic that would be an absolute mess to implement.

Does anyone know if this has been done before and if a more elegant
solution (or working piece of code) already exists?

BR
Yngve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,422
Latest member
LatashiaZc

Latest Threads

Top