# How to create a cycling clock circuit from scratch?

I'm thinking about doing a project where I have basic components (hex inverter chips, breadboards, jumper wires, transistors, capacitors, etc.) and I create a simple computer. I've been trying to design a circuit that will have a clock (I don't want to use 555 chips for this challenge) and it will cycle through the outputs one by one, restarting once it reaches the end (see the truth table below).
T----IN----OUT1----OUT2----OUT3----OUT4
1----DC----on--------off----------off---------off
2----DC----off-------on-----------off---------off
3----DC----off-------off-----------on--------off
4----DC----off-------off-----------off--------on
5----DC----on------off------------off--------off
T represents time (probably 1T=10ms), the DC under IN means that it's just steady dc voltage, and I think the rest is pretty self-explanatory. I really don't know what something like this would look like, so anything would help. Thanks in advance! EDIT: Would the attached schematic work (not gates inserting energy to the circuit)?

simulate this circuit – Schematic created using CircuitLab

Quick input means just a quick burst of power (possibly a capacitor discharge) that sets off the whole circuit

• Nothing to do with you sat on a bicycle then? Oct 19, 2020 at 16:43
• useful search terms : Johnson counter, ring counter. Oct 19, 2020 at 16:44
• @Andyaka I'm not quite sure what you mean by that. Oct 19, 2020 at 16:47
• That's very much a "full on computer"! Go have a look at something like the MIT open courseware 6.004 class to understand how you get from logic gates and flip flops to a processor capable of running even the most primitive sort of program. Oct 19, 2020 at 16:56
• You're on a great and absolutely worthwhile quest of learning, but your "there's just this one thing" is a demonstration of the basic fact that you don't know what you don't know. Fortunately, what you need to know is basically a semester long class in any engineering program, and at least one (probably more) has its full contents available for free online: logic gates, flip flops, state machines, programmed machines. You need to understand each, and then you can build a computer... but once you understand the complexity, you'll probably not chose to breadboard it. Oct 19, 2020 at 17:05

What you're proposing is called a ring oscillator. They do get used inside ICs for example, but it's bound to give you some headaches if you're attempting to make it from ordinary parts on a breadboard.

Instead, go digital. Use a normal oscillator (yes, even a 555) and make a count sequence with two flip-flops and some gates. The circuit below is a Johnson counter, sometimes called a 'walking ring' counter, decoded with 4 AND gates to produce a 4-bit pulse train:

Simulate it here: Decoded walking-ring counter

The benefit of using this approach is that the pulses are exactly timed, and because the counter changes only 1 bit at a time, the pulses are free from glitches.

As far as simulating a 'computer', that's a larger problem. A very basic system has the following elements:

• clock generator
• program store
• program counter
• instruction decode
• data path / ALU
• registers

You can make these from chips, and there's online tutorials on how to do that for well-known devices like the 6502 or 8080.

Really, though, much easier to simulate this stuff using a hardware description language like Verilog or VHDL. You can get free eval tools from FPGA vendors to do that.

If you're comfortable with C, Verilog should be an easy transition. VHDL is more powerful than Verilog in some ways, but it is much wordier. The split is something like C vs. C++: FPGA people tend to use VHDL because they value its abstraction and strong typing (like C++); chip people tend to use Verilog because they value its low-level explicitness and weak typing (like C).

Still others don't care, and use something like Matlab or some other high-level flow to generate HDL code.

There are also graphical sim tools like Logisim that kind of work, but I don't think they work that well for bigger projects. You soon reach a point where the design resembles spaghetti, constrained by how you can draw it.

I've introduced you to a simulator: Falstad. It's pretty great for quick sims. Of all the sims I've tried it does the best job at visualizing the circuit - especially tricky ones like the ring oscillator you proposed. It has lots of examples (yes, even the 555 - it's there too).

On the other hand... <insert hate for CircuitLab here.>

Big picture: Doing digital? Learn Verilog, and prosper.