Inside almost every piece of technology is a tiny clock that ticks at a rate of over a billion times a second, generating a digital heartbeat that is critical to regulating the execution of code, the movement of data in the processor and memory, the generation of wireless signals for transmitting data, and much more. But how do we generate a clock that precisely pulses at less than half a nanosecond? Surprisingly, this billions-of-times-a-second heartbeat, or gigahertz clock signal, is incredibly similar to how a ten-dollar analog wall clock ticks through the seconds, minutes, and hours of the day. Let's explore the internal workings of both analog and digital clocks to uncover their fascinating similarities and differences.
Analog Clocks: The Gear Train and Electromagnet
The Gear Train
Inside a simple wall clock, five unique systems enable it to work. The most recognizable is the gear train made from eight gears. At the beginning of the gear train, a driver gear is rotated by an electromagnet which provides the force to rotate the clock hands.
The Electromagnet
This electromagnet is composed of a coil of wire, which uses electrical current to generate a magnetic field, and a strip of iron to channel that magnetic field to the drive gear. Every second, the electromagnet switches directions, causing the magnet inside the driver gear to rotate 180 degrees in order to align its permanent magnet with the fields produced by the electromagnet. Consequently, the driver gear rotates fully around once every two seconds.
Gear Reductions
Most of the gears in the gear train are compound gears, each of which has two different gears, one on top of the other. To move the second hand, which is mounted on a shaft through the clock center, we go through a 12 to 48 gear reduction and then an 8 to 60 gear reduction, thereby reducing one revolution every two seconds down to one every 60 seconds. The minute hand is driven through an 8 to 64 gear reduction to the idler, followed by 8 to 60 to the minute hand. Finally, the hour hand is driven via a 15 to 45 reduction to the idler and a 10 to 40 gear reduction to produce one rotation every 12 hours. As a result, we have three shafts rotating to which the hands of the clock are mounted, each rotating at different speeds.
Time-Setting Gear
The last gear is used to set the time. Interestingly, this gear has 13 teeth on it and rotates once every 69 minutes. The time-setting gear directly rotates the minute and hour hands, but the gear with the second hand doesn’t move because the two parts of this compound gear slip from the high torque required to rotate the second hand 52 times per rotation of the time-setting gear.
Digital Clocks: The Quartz Crystal Oscillator
Quartz Crystal Oscillator
Now, let’s dive into the quartz crystal oscillator and see what makes this clock nearly identical to the digital clock in your computer. Inside a metal cylinder is a quartz crystal tuning fork with wires printed onto the side which travel along the legs to the outside of the metal canister.
Piezoelectric Effect
When a negative charge is applied to the printed wires, an electric field is directed to the crystal lattice, causing the negatively charged oxygen atoms to be pushed away and the positively charged silicon to be pulled towards the wire. This movement results in a lengthening of the crystal lattice. Conversely, when a positive charge is applied, the crystal lattice shrinks in length. This lengthening and shrinking, called the piezoelectric effect, causes the leg of the tuning fork to move back and forth.
Resonant Frequency
The crystal bounces back and forth, creating positive and negative voltages with a frequency of oscillation dependent on the crystal lattice's orientation, shape, and dimension. Manufacturers often add small amounts of metal to the ends of the crystal to tune it to the desired frequency.
Continuous Oscillation
To get a crystal to continuously oscillate, a changing voltage needs to be repeatedly applied to the wires on the legs. This is done using an integrated circuit with an inverter to form a feedback loop and two capacitors to assist in the timing of the voltage from the inverter and feedback loop, thus producing a resonant movement in the crystal. The signal is then fed to another section in the integrated circuit where a binary counter counts each cycle, and after 32,768 cycles (one second), a signal is sent to the electromagnet controller, flipping the direction of the electromagnet and moving the hands of the clock forward by one second.
From Analog to Digital: High-Frequency Clock Generation
Ring Oscillator
To generate a clock between 1 to 5 gigahertz, which is 30 to 150 thousand times faster than a single oscillation of the quartz crystal tuning fork, we use a ring oscillator. By adding inverters into the loop, the output rapidly oscillates between a 1 and a 0.
Voltage-Controlled Oscillator (VCO)
Due to temperature and physical geometry dependencies, the ring oscillator's frequency can vary. To stabilize the output frequency, a phase-locked loop (PLL) is used. A crystal oscillator with a stable resonant frequency is used alongside a voltage-controlled oscillator (VCO). A frequency and phase comparator outputs a signal equal to the difference between the crystal and the VCO frequency, and this signal is integrated into a steady voltage to drive the VCO, ensuring the output frequency matches the desired frequency.
Frequency Divider
To achieve the desired high frequency (e.g., 2.4 gigahertz), a frequency divider is used in the feedback loop, dividing the frequency by a specific factor (e.g., 150). The signal is then stabilized and adjusted to match the required frequency.
Understanding how both analog and digital clocks work reveals the intricate yet fascinating engineering behind these everyday devices. Whether it's the mechanical gear train of a wall clock or the precise oscillations of a quartz crystal in a computer, these technologies highlight the blend of classic engineering and modern innovation. The future will continue to demand a deep understanding of these principles, driving advancements in technology and engineering education.