High-Level View
Here is a quick overview of the components of a digital clock at a high level.At the heart of the clock there is a piece that can generate an accurate 60-hertz (Hz, oscillations per second) signal. There are two ways to generate this signal:
- The signal can be extracted from the 60-Hz oscillations in a normal power line. Many clocks that get their power from a wall socket use this technique because it is cheap and easy. The 60-Hz signal on the power line is reasonably accurate for this purpose.
- The signal can be generated using a crystal oscillator. Obviously, any battery-operated clock or wristwatch will use this technique instead. It takes more parts, but is generally much more accurate.
![]() |
To actually see the seconds, then the output of the counters needs to drive a display. The two counters produce binary numbers. The divide-by-10 counter is producing a 0-1-2-3-4-5-6-7-8-9 sequence on its outputs, while the divide-by-6 counter is producing a 0-1-2-3-4-5 sequence on its outputs. We want to display these binary numbers on something called a 7-segment display. A 7-segment display has seven bars on it, and by turning on different bars you can display different numbers:
![]() |
To convert a binary number between 0 and 9 to the appropriate signals to drive a 7-segment display, you use a (appropriately named) "binary number to 7-segment display converter." This chip looks at the binary number coming in and turns on the appropriate bars in the 7-segment LED to display that number. If we are displaying the seconds, then the seconds part of our clock looks like this:
![]() |
The output from this stage oscillates at a frequency of one-cycle-per-minute. You can imagine that the minutes section of the clock looks exactly the same. Finally, the hours section looks almost the same except that the divide-by-6 counter is replaced by a divide-by-2 counter.
Now there are two details left to figure out if you are building a real clock:
- The clock as designed here does not understand that at 12:59:59 it is supposed to cycle back to 1:00. That is a messy little problem, and there are a couple of ways to solve it. One technique involves creating a little bit of logic that can detect the number 13 and reset the hour section back to 1 (not zero). Another technique involves using an adder. For our purposes, it is easier to deal in military time, because military time includes a zero hour.
- We need a way to set the clock. Typically this is handled by gating higher-than-normal frequencies into the minutes section. For example, most clocks have "fast" and "slow" set buttons. When you press the "fast" button, the 60-Hz signal is driven straight into the minutes counter. When you press the "slow" button, a 1-Hz signal is driven into the minutes section. There are other possible techniques, but this one is the most common.




