13 Nov 2013

How does a Computer Clock Works


Do you ever wonder how a computer clock works? You shut down your computer and when you start it up again ever after a few days, you can count on the system clock. It gives you correct Date and Time information. Now, lets explore how it manages to stay live and why we don't have to update the clock every time we start the computer like we used to on our mobiles some years ago.computer-battery
Every personal computer contains two clocks: a built-in hardware clock and a virtual clock.
The hardware clock (real-time clock) runs whether the system is on or off. The virtual clock (system clock) is set to the real-time clock when the computer is turned on and exists only while the computer is operating. While the computer is up and running, the two clocks run independent of each other.

The system clock is a 24-hour timer and has no real concept of days, whereas the real-time clock tracks the time and date. In fact, the system clock has no concept of traditional hours, minutes, and seconds. It merely increments a counter 18.2 times per second. The operating system, which is dependent upon the system clock for the time, converts the counter into hours, minutes and seconds.
As for the date, the operating system reads the real-time clock via the BIOS during initialization, then tracks the date independently based on the virtual-system clock rolling over midnight.
Since the two clocks run independently, the real-time clock can be set to any nonsensical value and the operating system will not notice.

No comments:

Post a Comment