A flip flop can be viewed as an electronic device that is capable of assuming one of two possible stable states at a given time. The deciding factors that dictate as to which state the flip flop will assume consists of a gating signal, often termed a clock; either one or more control signals; and its previous state. It is this gating signal that makes this device be classified as a flip flop since otherwise it might as well be called a latch if it were not present.
Since the shortcut method involves changing the logic around the Toggle Flip Flop, or T-FF, to achieve the desired modulo-n counting, we will concentrate on its behavior with the macro model rather than individual gates. The Toggle Flip Flop is special to the shortcut method because it only has one control input that enables it to change its state when the clock input changes from low to high or high to low depending upon implementation. As such, the behavior of the T-FF in the following table is dependent upon the clock signal changing.
| T | Qcurrent | Qnext | Behavior |
|---|---|---|---|
| 0 | 0 | 0 | No state change |
| 0 | 1 | 1 | No state change |
| 1 | 0 | 1 | State change |
| 1 | 1 | 0 | State change |
If we were to only concentrate on when the "T" input is set to 1, we find that the state or output of the flip flop changes for every clock period. This behavior suggests that the flip flop is dividing the clock's input frequency by a factor of two or, with a little more imagination, is counting the number of clock periods that have passed. As to which portion of the clock's period this change takes place is subject to the flip flop's designer because there are many variations such as edge and level triggered. For this tutorial, we are going to use the falling edge triggered type since it is, in my humble opinion, easier to work with for understanding counters.
![]()
The frequency of the "Output" signal is half that of the "Clock" signal's
With all this talk of the T-FF, it is surprising to find that this kind of flip flop is virtually nonexistent (at least to my knowledge) and thus can not be bought in readily available form. Instead, other flip flops are converted into T-FFs by either tieing together their control inputs or using external logic. The flip flop that is the easiest to convert into a T-FF is the JK-FF since one just has to tie both the J and K input controls together and mark that as the T input.
Since a flip flop all by itself is rather boring (like some politicians that do the same thing) we can string them together in a sort of array to make more complex functions such as counters. These counters, being the reason this tutorial is here in the first place, allow us to implement even more advanced functions that will most certainly be useful in other applications such in the design of computers.
Later in the tutorial, step 4 to be exact, we will use the results from a comparison table to select what kind of external logic to shove in front of the T-FFs. The "lockout" function, one of the three possible answers we will obtain from the comparison table, is implemented by inhibiting the passing of a '1' from one portion of logic to the next. Assuming active high, this is done by ANDing the incoming signal from the past logic with the control signal and then feeding it into the proceeding logic. Furthermore, for reasons discussed in the next few pages, the generated control signal is inverted before the AND gate because it will only become active when the final count is reached.

Logic to "Lock Out" a Signal
Injecting a signal is a little simpler than locking one out because all we have to do to fulfill this requirement is to insert an OR gate between our two masses of logic. The idea behind this is that we would want to put a '1' on the T-FF's input to make it change its state on the falling edge of the clock. The signal from the previous logic is ORed with the control signal and the output is fed into the proceeding portion of logic.

Logic to "Inject" a Signal