The four rows shown in the table below, excluding the very top one, are what you need to find which gates to use in order to make almost any modulo counter that you may need. The descriptors on the very right of each row are elucidated as follows:

Notice that the top most row indicates where each bit, relative to one another, is to be placed. This will be very important in remembering because the stages of the counters that are drawn in this tutorial are so that the LSB stage is on the far left. This is in sharp contrast to the corresponding LSB on the table which is to the far right. One, however, has the freedom to tweak the order that the table and/or stages so that both follow the same bit progression but that is up to personal preferences.
The next few rules are what we are to use for determining which gates to use for making the Mod-2^n counter behave in Mod-non 2^n counter way. We noted, on the previous page, that constructing a mod-2^n counter was relatively short and straightforward while a mod-non 2^n counter required a few additional steps. For these rules to be valid, we must first isolate one column from another and then compare the bit that is present in a row against another row for that targeting column.
First Comparison
Second Comparison (Skip this if your first comparison resulted in a dash)
EXAMPLE:
Make a comparison table for a mod-25 counter.
From the equations given on page 3, our counter would need 5 stages. Since the exercise did not indicate to what count should the counter return to after reaching the "final count", we would assume that the most probable return value would be 0.

Now, we go column by column to find what kind of gate(s) we need for each stage to make the generic mod-32 counter into a mod-25 counter. Note that the order we choose to address the columns in does not matter.
Starting at the LSB, we find that since the mod-n bit is different than the bit for the return number, we would then need to compare the final count bit to the mod-n bit. Since the final count bit is the same as the mod-n bit, we would put an INV-AND in the "Gates" row.

Proceeding onward to the next significant bit, we find that since the mod-n bit matches that of the bit for the return number, we are able to put a dash in the "Gates" row.

The next significant bit presents the same scenario as the last and thus all we have to do is put a dash.

Moving on to the next significant bit shows that since the mod-n bit is different than the bit for the return number, we will have to compare the final count bit and the mod-n bit. This second comparison test (not to be confused with the infinite series tests in Calc II >.< ) results in this stage/column requiring an OR gate.

For the most significant bit, finally, we see that this is just like the last scenario in which the second comparison test yields the requirement of having an OR gate on this stage.

Seeing as there are no more columns left to address, we are done with this example.
EXAMPLE:
Make a comparison table for a mod-10 counter.
To find what gates to put in front of each stage to make this generic mod-2^4 counter into a mod-10 counter, we proceed onto the comparison table step.

So... now that we have completed the comparison table, how do we exactly insert these gates into our counter? This is what the next section covers.
Being that this step is used to convert a mod-2^n counter into a mod-non 2^n counter, what would happen if we were to use this step anyway to create a mod-2^n counter? The straightforward answer would be that you would get a dash for each column in the "Gates" row, and thus you would do nothing to the counter so no harm would be done (Now granted you just wasted a couple of seconds of your life but that is another matter). This being stated, you will NEED to use this table on a mod-2^n counter if the return number is not zero since the mod-n bits would no longer match the return number's bits.
EXAMPLE:
Make a comparison table for a mod-16 counter that returns to zero and a comparison table for a mod-16 counter that returns to 1.
The mod-2^n comparison table justifies our initial assumption that one need not use such a table for designing a mod-2^n counter that rolls over back to zero. Note that although we needed 4 bits to count to 15, our final count, we had to add an extra column to accommodate the number of bits needed by the mod-n's row. This extra bit is not used to compare against anything since we would not have that additional stage in our counter design.

On the other hand, if the counter was made to return to the number one, instead of zero, we would have to use the comparison table because the natural roll over to zero would have to forced roll over to one.
