Skip to content

Lec 03-04-2025: Non-Binary Counter | CSCI 343

A non-binary counter is a synchronous counter that cycles through a subset of states, skipping others. In this example, we design a counter for the following sequence using JK flip-flops:

01245600 \to 1 \to 2 \to 4 \to 5 \to 6 \to 0 \to \cdots

States 3 (011) and 7 (111) are missing from the sequence, so they are the unused states for this counter. When drawing the state diagram, we have the option to include them as nodes but with no transitions leading into them, since they’re unused — we treat them as don’t-care conditions in the K-maps.

State diagram of a non-binary counter cycling 000→001→010→100→101→110→000 in a hexagon, with isolated nodes 011 and 111 shown as unused states

We first lay out the state table for the desired transitions:

Q(t)Q(t+1)f/fInputsABCABCJAKAJBKBJCKC000001001010010100100101101110110000\begin{array}{ccc|ccc|cccccc} & Q(t) & & & Q(t{+}1) & & & & \text{f/f} & \text{Inputs} & & \\ \hline A & B & C & A & B & C & J_A & K_A & J_B & K_B & J_C & K_C \\ \hline 0 & 0 & 0 & 0 & 0 & 1 & & & & & & \\ 0 & 0 & 1 & 0 & 1 & 0 & & & & & & \\ 0 & 1 & 0 & 1 & 0 & 0 & & & & & & \\ 1 & 0 & 0 & 1 & 0 & 1 & & & & & & \\ 1 & 0 & 1 & 1 & 1 & 0 & & & & & & \\ 1 & 1 & 0 & 0 & 0 & 0 & & & & & & \\ \end{array}

The JK flip-flop’s excitation table tells us the required J and K inputs for any given Q(t)Q(t+1)Q(t) \to Q(t{+}1) transition:

Q(t)Q(t+1)JK000X011X10X111X0\begin{array}{cc|cc} Q(t) & Q(t+1) & J & K \\ \hline 0 & 0 & 0 & X \\ 0 & 1 & 1 & X \\ 1 & 0 & X & 1 \\ 1 & 1 & X & 0 \\ \end{array}

We apply the JK excitation table to determine the required J and K inputs for each flip-flop in each state transition:

Q(t)Q(t+1)f/fInputsABCABCJAKAJBKBJCKC0000010X0X1X0010100X1XX10101001XX10X100101X00X1X101110X01XX1110000X1X10X\begin{array}{ccc|ccc|cccccc} & Q(t) & & & Q(t{+}1) & & & & \text{f/f} & \text{Inputs} & & \\ \hline A & B & C & A & B & C & J_A & K_A & J_B & K_B & J_C & K_C \\ \hline 0 & 0 & 0 & 0 & 0 & 1 & 0 & X & 0 & X & 1 & X \\ 0 & 0 & 1 & 0 & 1 & 0 & 0 & X & 1 & X & X & 1 \\ 0 & 1 & 0 & 1 & 0 & 0 & 1 & X & X & 1 & 0 & X \\ 1 & 0 & 0 & 1 & 0 & 1 & X & 0 & 0 & X & 1 & X \\ 1 & 0 & 1 & 1 & 1 & 0 & X & 0 & 1 & X & X & 1 \\ 1 & 1 & 0 & 0 & 0 & 0 & X & 1 & X & 1 & 0 & X \\ \end{array}

States 3 (011) and 7 (111) are unused — they are treated as don’t-care conditions (XX) in every K-map cell.

If we wanted, we could include them in the table — their flip-flop input entries would just be all don’t-cares:

Q(t)Q(t+1)f/fInputsABCABCJAKAJBKBJCKC0000010X0X1X0010100X1XX10101001XX10X011XXXXXXXXX100101X00X1X101110X01XX1110000X1X10X111XXXXXXXXX\begin{array}{ccc|ccc|cccccc} & Q(t) & & & Q(t{+}1) & & & & \text{f/f} & \text{Inputs} & & \\ \hline A & B & C & A & B & C & J_A & K_A & J_B & K_B & J_C & K_C \\ \hline 0 & 0 & 0 & 0 & 0 & 1 & 0 & X & 0 & X & 1 & X \\ 0 & 0 & 1 & 0 & 1 & 0 & 0 & X & 1 & X & X & 1 \\ 0 & 1 & 0 & 1 & 0 & 0 & 1 & X & X & 1 & 0 & X \\ {\color{red}0} & {\color{red}1} & {\color{red}1} & X & X & X & X & X & X & X & X & X \\ 1 & 0 & 0 & 1 & 0 & 1 & X & 0 & 0 & X & 1 & X \\ 1 & 0 & 1 & 1 & 1 & 0 & X & 0 & 1 & X & X & 1 \\ 1 & 1 & 0 & 0 & 0 & 0 & X & 1 & X & 1 & 0 & X \\ {\color{red}1} & {\color{red}1} & {\color{red}1} & X & X & X & X & X & X & X & X & X \\ \end{array}

JA:J_A:

K-map for J_A

JA=BJ_A = B

KA:K_A:

K-map for K_A

KA=BK_A = B

JB:J_B:

K-map for J_B

JB=CJ_B = C

KB:K_B:

K-map for K_B

KB=1K_B = 1

JC:J_C:

K-map for J_C

JC=BJ_C = B'

KC:K_C:

K-map for K_C

KC=1K_C = 1

To check whether the circuit is self-correcting, we plug each unused state into the derived flip-flop expressions and trace where the circuit goes next. As with the S/R case covered previously, we interpret the resulting J/K values according to the flip-flop’s characteristic behavior: J=0,K=0J=0, K=0 holds; J=1,K=0J=1, K=0 sets; J=0,K=1J=0, K=1 resets; and J=1,K=1J=1, K=1 complements (toggles).

JA=BJB=CJC=BKA=BKB=1KC=1\begin{aligned} J_A &= B \quad & J_B &= C \quad & J_C &= B' \\ K_A &= B \quad & K_B &= 1 \quad & K_C &= 1 \end{aligned}

Unused state ABC = 011:

JA=B=1KA=B=1complement A (01)JB=C=1KB=1complement B (10)JC=B=0KC=1reset C to 0\begin{aligned} J_A &= B = 1 \quad & K_A &= B = 1 & &\Rightarrow \text{complement } A \text{ (}0 \to 1\text{)} \\ J_B &= C = 1 & K_B &= 1 & &\Rightarrow \text{complement } B \text{ (}1 \to 0\text{)} \\ J_C &= B' = 0 & K_C &= 1 & &\Rightarrow \text{reset } C \text{ to } 0 \end{aligned} 011100011 \to 100

State 100 is valid, so the circuit self-corrects out of state 011.

Unused state ABC = 111:

JA=B=1KA=B=1complement A (10)JB=C=1KB=1complement B (10)JC=B=0KC=1reset C to 0\begin{aligned} J_A &= B = 1 \quad & K_A &= B = 1 & &\Rightarrow \text{complement } A \text{ (}1 \to 0\text{)} \\ J_B &= C = 1 & K_B &= 1 & &\Rightarrow \text{complement } B \text{ (}1 \to 0\text{)} \\ J_C &= B' = 0 & K_C &= 1 & &\Rightarrow \text{reset } C \text{ to } 0 \end{aligned} 111000111 \to 000

State 000 is valid, so the circuit also self-corrects out of state 111.

With the self-correction transitions now known, we can complete the state diagram by adding the transitions out of the unused states:

Complete state diagram showing the non-binary counter cycle 000→001→010→100→101→110→000, plus self-correction transitions 011→100 and 111→000