# How can the minimal number of bits representing modulus of counter be smaller than the number of bits representing our output?

Suppose we want to have this sequence 30, 50, 1003, 30, etc... It's no hard to see that we need a MOD-3 counter because there're only 3 states. But this also means we need 2 flip flops. But how do we represent 30 or 50 in the output? What is the design of such counter? Do we have to use a decoder to map 0 -> 30; 1 -> 50 and 2 -> 1003?

I'm new to electronics so my question might be quite silly but this seems so confusing to me. If I have to design a counter that results in another sequence like: 000, 001, 101, 000,... then it's three flip flop matching with three bits of our output (Q2, Q1, Q0 and D2, D1, D0 would be function of Q2, Q1, Q0 if we're using D flip flop and designing synchronous counter). Again, this is MOD-3 counter which only requires 2 flip flops!?

How can such circuit be designed? Thank you in advance! :D

• There are many devices to choose from: TFF, DFF, JKFF. The power up state can be adjusted too depending on the specific implementations. And these usually have both Q and not Q outputs, but not always. A general procedure takes a lot of words, plus multiple concrete examples, to illustrate. Too much to write here. But this isn't hard. It will just take some work on your part. Going to sleep now. But I'll reference many examples I've already produced here when I wake up.
– jonk
Commented May 30, 2022 at 8:48
• For example, though, see this.
– jonk
Commented May 30, 2022 at 8:59
• "But how come do we represent 30 or 50 in the output?" - how do you want to represent it? Commented May 30, 2022 at 9:06
• You use a lookup table (essentially a small ROM) to map the 2-bit state value to any number of bits for the output value. Nobody ever said that the state bits always have to be used directly as the output bits. Commented May 30, 2022 at 9:47
• you could have two output wires and attach a sticky note saying low/low means 30, low/high means 50 and high/low means 1003 Commented May 30, 2022 at 10:05