Home

Back

Search

 
Digital Clock Signal

Prerequisites: 

What is a Clock Signal

A digital clock signal is basically a square wave voltage similar as the one shown below:

As shown, it has only two levels, one is zero and the other one is high, which the high level can be different according to the requirement of the circuit. For example the high level in TTL standard is 5V. This signal mostly has a 50% duty cycle, meaning that the duration of a high and a zero is the same. The frequency of the clock can be anything as needed by the digital circuit that is using it. But what is a clock used for?

Digital circuits always have some input and generate digital outputs accordingly. Some digital circuits are not clocked, meaning that the input applied to the circuit flows through digital gates without any timing or storage and generates the output. It only takes a time equal to the propagation delay time to reach the output.

On the other hand most of the digital circuits that do more complex processing on the digital inputs such as controllers, processors or state machines are timed and the signal can't just go through. In these circuits a clock with a fixed frequency is used for timing. A clock plays very important role as it is used to open and close digital paths, allow or stop a process and in general provide timing for the circuit. You can compare a clock with the traffic lights. They stop and allow the traffic in a timely manner so that the traffic can flow smoothly with the least delays. If you just let the traffic through there will be a big jam and the output is unpredictable.

Clocks are especially used for digital circuits with feedbacks and also to avoid glitches in a circuit. What is a glitch? A glitch is an unpredictable output. Say you have some input and for those you expect a known output, but before the output settles to what you expect, you might have one or more transitions that are not suppose to be there. These are called glitches. They happen because the inputs have to go through different gates and the propagation delay of each can be different. Therefore the results arrive to the final gates in different times. This difference in data arrival results in changes in the output until all signals settle and the output is valid. If glitches are not eliminated, they will go to the next stage of the circuit and generate more unpredictable results. To avoid them a clock can be used to time the signals. Assume the inputs to the circuit are provided with one rising edge of the clock and the output of the circuit is read by the next rising edge of the clock. If the period of the clock signal is higher than the total propagation delay of the circuit, the output will be read when it is completely settled and therefore no glitch happens.

To store and pass the data or digital signals through, some specific gates are used which are called latches or flip-flops. These are some kind of memory that store their input over their output by a specific level or edge of the clock.

A clock with a higher speed will allow a faster process and that's why we see the increase in the clock frequency in computers and processors every day. But you may ask why won't we just increase it to the maximum already? Well it is not that easy. As mentioned before clock has to wait enough time for all the data to be ready and then pass them forward. This means that the digital circuit delay becomes a very important factor in all this. If the circuit delay is high, the clock has to be slow to allow enough time for the data to arrive. Therefore increasing the clock frequency is only possible if the circuit delay decreases and that is a very hard thing to do in most cases.

How to Generate a Clock

A clock generator is used to generate a clock, which is an oscillator that provides a square wave output. An oscillator circuit always has a feedback that makes the circuit oscillate. This feedback also provides parameters that can make a certain frequency. There are many different ways to make an oscillator. Below you can see two of the famous ones. First is to use a simple Inverter plus a feedback component which usually is a crystal.

Crystal is an electrical component that is a very precise filter allowing only a very specific frequency through. It usually looks something like below, well it can come in any different size and form:

They call it crystal because inside the package there is a piezoelectric crystal with a very specific size and weight. A piezoelectric crystal, when voltage is applied to it, can resonate with a very precise frequency that depends on its size and properties and allows only signals with its resonance frequency though. That's why it is used to filter any other frequency and provide a fixes frequency signal. The resonance frequency of the crystal is written on its package.

In the Circuit shown above, first assume the input of the inverter goes low and therefore the output goes high. This transition which is usually very sharp contains many different frequency harmonics, but only the one with the same frequency as the crystal passes through. So the high goes to the inverter input and its output drops to low. This happens continuously and therefore resulting in a square wave with a fixed frequency.

Below is another circuit using a Schmitt_Triggered inverter.

A Schmitt-Triggered inverter compares the input signal with two thresholds instead of one as in simple inverters or gates, the input has to be higher than one threshold for the output to change, and lower than the other one for the output to change back. It generates a hysteresis pattern which is showed in the figure below for the inverter:

Arrows in the graph show the direction of the input voltage change. When there is a low on the input of the inverter and a high at its output, the capacitor on the input of the inverter is charged through the feedback resistor. When the capacitor is charged high enough that the input voltage of the inverter passes the higher threshold, then it's output drops to zero. Now the capacitor starts discharging through the same resistor and when its voltage drops below the lower threshold of the inverter, its output jumps up again and this action keeps happening resulting in the clock signal. Figure below shows the input and output waveforms of the inverter.

The oscillating frequency of this circuit depends on how fast the capacitor charges and discharges, and therefore is a factor of the resistance and capacitance values, while it is also dependent on the threshold levels.

Written by: Mehdi Sadaghdar

Please feel Free to forward your comments to: info@designcabana.com