# Feedback loops and Logic Gates

digital-logicfeedbacklogic-gates

Setup: a simple 3 bit incrementer that is both connected to a digital display and to itself

simulate this circuit – Schematic created using CircuitLab

Assuming that there is no clock to regulate the timing of outputs, what would happen?

If constant power was given to the circuit, I imagine the incrementer would start by outputting 001 to both the display and itself. But that 001 was based off an input of 000, which has now changed.

I am guessing that one of two things would happen: either (A) this state is a paradox and the incrementer continues to output 001 until it has no power, or (b) the display would continuously show a different number, changing at the speed it takes for the current to travel around the circuit.

I'm going to hand wave over a lot of detail here, but the short answer is that your "b" is correct. You effectively have a race condition and in order to answer exactly what happens you need to know about the propagation delay of your logic (and if we want to really dive into the nitty gritty wire delay etc). You would need to know how the 3 bit counter is implemented (e.g. with which gates and how those gates are implemented) and the propagation delays of the gates. You can think of the propagation delay of the gate as the "delay" of the gate. For example, if you take an inverter and toggle the input there's some delay till the output stabilizes. Take a look at this data sheet and search for "tphl" and "tplh". Notice that the two propagation times are not equal.

It is not necessarily true (in fact it is very probably necessarily not true) that all outputs of the counter toggle at the exact same time. Some outputs (depending on the implementation the more significant bit outputs) will require more logic and thus probably have a greater combinatatorial path to path to output (read more propagation delay). Furthermore there is no reason to assume that the inputs to the counter start at 3'b000. With these two facts the output of the counter will run around like crazy (the shortest combinatorial path way will gate the max output frequency e.g. the shortest combinatorial path will limit how fast the fastest output bit changes). Your display won't be able to keep up with the counter and will effectively display "random" numbers (obviously what the display actually shows depends a lot on its implementation).

For a simplistic, but similar example google "ring oscillator" (but don't build one unless it's for educational purposes only!) and "propagation delay of logic gates".