1
\$\begingroup\$

I'm a mechE and have been trying to get into the digital world for a bit and need to know why a system would need a clock signal at all. For example, if I have some bit of code getting executed on a device, why can't the logic gates performing code be controlled by logic such as this, "this gate does not open until I receive voltage here:"? and so on. Why does it need to operate by "this gate opens after so many clock signals"?

Thanks

\$\endgroup\$
  • \$\begingroup\$ Code must be clocked to go from one logic state to the next with external inputs and outputs. Common speeds range from 32kHz like a watch to uW power PIC of to 50MHz to 5GHz on fast CPUs \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Sep 23 '18 at 2:31
  • \$\begingroup\$ Think about another logic: what are you going to do after the gate opens? \$\endgroup\$ – Long Pham Sep 23 '18 at 2:32
  • \$\begingroup\$ so is what your saying is that i have no time guarantee when i get a voltage at a certain location? this would make the most sense to me but then i have to think about the time loss of each operation, right? \$\endgroup\$ – shakeNbake Sep 23 '18 at 2:58
  • \$\begingroup\$ typical computers have a "program counter", which needs a pulse or clock to increment the "counted value" to the next value and thus allow access to the next instruction. A fancier counter, with a parallel-load feature, permits jumping to arbitrary addresses. Life is good. \$\endgroup\$ – analogsystemsrf Sep 23 '18 at 4:48
  • \$\begingroup\$ great answer for a mechE to understand, thank you. \$\endgroup\$ – shakeNbake Sep 23 '18 at 4:52
2
\$\begingroup\$

A lot of digital logic, so-called "combinational" logic, indeed does not require a clock. Typically, a clock is used when some value needs to be stored, using what's called a latch or a flip-flop. The clock fixes the time at which the old value is discarded and the new value is accepted. This enables us to guarantee that a new value isn't accepted until all the combinational logic producing that value has "settled", i.e. all changes have propagated from the inputs to the output and the output will not change again.

Clocks are also used to help synchronize a signal, when sending data between two places, i.e. between one device and another. The receiving device can use the clock as a reference to determine when it's time to read the next bit/value. It's possible to transmit data without an explicit clock, but the clock makes decoding the signal easier.

This is in fact also true in the case of digital logic circuits -- it's possible to make complex circuitry without using clock signals, but the clock signals make it much easier. In this case, though, it's extremely difficult to go without a clock; in practice, at present nobody does it except in experimental work. There is a history of "asynchronous" (clockless) computing here: https://en.wikipedia.org/wiki/Asynchronous_circuit -- as far as I know, everything listed there is experimental. Quoting:

"An asynchronous circuit, or self-timed circuit, is a sequential digital logic circuit which is not governed by a clock circuit or global clock signal. Instead it often uses signals that indicate completion of instructions and operations, specified by simple data transfer protocols. This type of circuit is contrasted with synchronous circuits, in which changes to the signal values in the circuit are triggered by repetitive pulses called a clock signal. Most digital devices today use synchronous circuits. However asynchronous circuits have the potential to be faster, and may also have advantages in lower power consumption, lower electromagnetic interference, and better modularity in large systems. Asynchronous circuits are an active area of research in digital logic design."

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.