What is the clock, why CPU clock needs, how the clock signal is generated?

What is the clock, why CPU clock needs, how the clock signal is generated?

First, know what is the pulse

Here Insert Picture Description
On a graph called a square wave pulse, the pulse beat similar to human. For each square pulse, a voltage or rises from 0 to a maximum value that line is called rising; conversely, gradually decreases the voltage or current of that line is called the falling edge. Called a pulse of a CPU 时钟信号, or 时钟脉冲. Pulse period is called a CPU clock cycle, one clock cycle of a clock signal oscillation.


Per pulse

The interval between two successive pulses occur, the pulse period is, it is the inverse of the frequency; and the number of pulses per unit time (1 sec) produced is called frequency.

Unit of frequency are: Hz (hertz), kHz (kilohertz), MHz (megahertz), GHz (gigahertz).

  • Wherein 1GHz = 1000MHz, 1MHz = 1000kHz, 1kHz = 1000Hz.

Calculated in units of time and the pulse signal cycle corresponding conversion relationship: s (seconds), ms (millisecond), μs (microseconds), ns (nanosecond)

  • Wherein: 1s = 1000ms, 1 ms = 1000μs (microseconds), 1μs = 1000ns.

CPU clock necessarily need to do?

CPU clock may have, or may not have a clock. Using the CPU clock is called a synchronous CPU (synchronous CPU), without using the CPU clock is called asynchronous CPU (asynchronous CPU). Currently on the market a wide range of CPU sales are synchronous CPU. Faster than synchronous CPU asynchronous CPU, because the CPU asynchronously in response to the input and output it immediately, synchronization is not required to wait for another signal, with less time, so the CPU faster than synchronous asynchronous CPU. So why most of the CPU with a clock way? Because it is asynchronous CPU design is very complex, although the time can be some advantages, but if the nanosecond level, fast 100ns 1000ns even for people who are almost imperceptible, but it increases the complexity of the circuit design, to We know the logic circuit CPU Bunsen is a feat of mankind, if in order to reduce the nanosecond time itself has increased its complex logic circuit, whether it is time or labor costs will be greatly increased. Therefore, CPU design engineers, certainly more than we know what kind of design, simultaneous CPU is the better choice.


Why CPU clock needs?

Earlier we know currently on the market are the need to synchronize the CPU CPU clock, the CPU clock Why do you need it?

Here is an article talking about the good, the CPU needs to explain why the clock: Why CPU clock concept needs

The following quote from the article above

First, consider the following logic:
Here Insert Picture Description
When A = B = 1, Q = 0. When the input signal changes, the logic element will not react immediately to changes in the input, there will be a propagation delay (propagation delay). B is 0 when the variation, since the XOR B also serves as direct input of the XOR gate XOR therefore perceives immediately enter a state change becomes 0, the output becomes the XOR 1. However, due to propagation delay, the output of the AND gate will only over a short time becomes 0, the output of the XOR can reproduce a short time interval after becomes 0 to 1. The figure is expressed as such:
Here Insert Picture Description
The above phenomenon is called flip (race condition), meaning that the output there is a pulse signal is not some hope.

A simple way is to place one edge on the output of flip-flop:
Here Insert Picture Description
the role of an edge trigger is input only when the CLK terminal changes from 0 to 1, the data input terminal D will effect the output of edge triggered flip flop. Thus, all of the propagation delay will be hidden away edge flip-flop, then the output terminal Q becomes stable. For example:
Here Insert Picture Description
wherein Q terminal when the gray portions represent no edge trigger output state. We can see that, when the trigger with the edge, Q terminal output becomes stable, substantially eliminates the propagation delay.

From the above example, we can see why the CPU clock: vast majority of existing microprocessors are being driven synchronous sequential circuit, a timing circuit and various logic gates. As said above, the logic gate takes a short time to react (propagation delay) the input changes. It is necessary to accommodate the propagation delay of clock cycles, and the clock period should be large to accommodate all the required logic gate propagation delay.

Of course, there Asynchronous sequential logic, that is, do not need to synchronize the clock signal. But although this asynchronous logic circuit faster than synchronous sequential circuit, but it is more complex than the design synchronous sequential circuit, and will meet the above said flip phenomenon (race condition), so now the vast majority of CPU clock still need do signal synchronization.


How the CPU clock is generated?
To know what is the oscillator

CPU clock signal is a pulse, what it can produce pulses that oscillator. In the logic circuit, a NOT gate connected end to end to form an oscillator. Remember the following NAND gate symbol of this figure.
Here Insert Picture Description
As long as NAND gate connected to the output and input can constitute an oscillator.
Here Insert Picture Description
The above is a logic circuit diagram of the oscillator, the oscillator is the following way.
Here Insert Picture Description
That is how this thing work? In understanding how this oscillator work before, there is a need to know what is normally closed relay contacts. Why should you know normally closed contact relay? Because of the NAND gate is implemented by a normally closed relay contacts to achieve. The figure is a normally closed electromagnetic relay contacts.
Here Insert Picture Description
We knew in junior high school physics, electricity magnetism, around the current generates a magnetic field, to be able to be able to make the CRC electricity generated magnetic iron, which is an electromagnet. FIG coil has a large, as long as both ends of the coil, with a certain voltage, the coil flows through the constant current to produce an electromagnetic effect, the armature will overcome the spring of the electromagnetic force acting to attract Back tension is attracted toward the core, so as to drive the movable contact and the normally closed contact separation, the normally open contact connected. When the coil power, the electromagnetic suction disappeared, the armature will return to the original position under the spring reaction force, so the movable contact and the normally closed contact back ON, the normally open contact separation. Such a relay is a normally closed contact NAND gate. 1 as it is input, 0 is output.

The situation is now the power switch, the armature separation; off the power switch, the plunger closes, so that oscillation can only once, to think if its output as the input, it can be isolated, closed, separated, ... is closed, as long as the power supply , it can always go oscillation. We refer to this as the output of the normally closed contacts of the relay next input is called the oscillator.

Therefore, when the power supply path, are attracted Tiebi title, the circuit is disconnected. When the circuit is broken, lost their appeal, the title Tiebi recovery position, the circuit is switched on again. Therefore, the output of the oscillator alternates between 0 and 1 changes, so will produce a one pulse, as shown below.
Here Insert Picture Description
You might ask, this thing is slow and big, how it may be used as part of the CPU?

Indeed, this thing can not be put into the CPU. He said the big guy, but in order to better understand what is the oscillator, which helps the understanding of the contents of the back.

That is to rely on the CPU to generate a clock pulse of a do? Generating a pulse oscillator must be, but in the CPU, the oscillator does not depend on electromagnets to achieve. CPU is an IC (integrated circuit), which is generated by the clock pulse oscillator.

Crystal

This article is very good: explain and use of crystal

Here Insert Picture Description

Published 48 original articles · won praise 18 · views 8753

Guess you like

Origin blog.csdn.net/weixin_44395686/article/details/105318472