4
\$\begingroup\$

In computer programming, it's easy to write code that operates sequentially, but in a logic circuit, where everything is on all at once, this isn't so simple.

Say I wanted to write some data to a register. I can't just set the data pins to their desired values and turn on the write-enable pin all at once, because this could lead to incorrect data being written as the data pins are transitioning at the same time as the write-enable pin. I'd have to turn on the write-enable pin after the data pins have finished transitioning and then turn it off before they transition to undefined values (or desired values for a different write).

How are modern high-speed logic circuits, for example in microprocessors, designed, on a logic gate level, to operate sequentially? Some possible ways I can think of are:

  1. Perform only 1 operation per clock cycle. This means that it could take 3 clock cycles to write data to the aforementioned register. This may be acceptable if the microprocessor is able to run many other (independent) operations in parallel.

  2. Have multiple clocks. Assuming your rise/fall times are fast, and your delay times are accurate, you could possibly generate multiple sub-clocks that operate at the same frequency as the main clock, but with different duty cycles and phase shifts.

  3. Take propagation delay into account. Modern integrated circuit design software that generate both the logic circuit and die layout from hardware description languages could possibly take the speed of electricity through on-chip wires into account in order to emulate sub-clocks. In theory, this would be ideal, because it could create a microprocessor that operates near the absolute maximum performance.

  4. Advanced logic algorithms. Perhaps there exists a way of transforming a sequential logic algorithm into a parallel logic algorithm.

\$\endgroup\$
2
  • \$\begingroup\$ You should know Mealy and Moore automata theory, to understand how a processor works. \$\endgroup\$ Commented Oct 8 at 11:21
  • \$\begingroup\$ You can enable write signal at the same time as setting data on bus if the write enable is trailing edge sensitive. Also all the points are already in use at least likely they are. \$\endgroup\$
    – Justme
    Commented Oct 8 at 11:37

1 Answer 1

7
\$\begingroup\$

You’ve pretty well figured out the basics.

For #1, if the previous clock has output the value you wish to write, then the next clock can latch the data. With a microprocessor like the Z80, an instruction can take from, say 4 clocks to over 18 depending on the exact operation.

#2, multiple phases/clocks - a very common technique. Read up on how the 6502 microprocessor works.

#3, has been done but the killer is the propagation delay can vary with voltage and temperature. So you always need a bit of margin to cope with that.

#4, frequently done but requires more resources.

The key to sequential logic is the ‘finite state machine’. This is a concept that can be implemented in a number of ways. With digital logic, a common example is a synchronous counter. You have a n bit register and a n bit incrementer (that adds 1 to the input). The output of the incrementer goes to the input of the register. The output of the register goes to the input of the incrementer. Each clock the register value increases by one. The YouTube’s have plenty of tutorials on this subject. Search for Ben Eater and others.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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