Skip to main content

Sequence detector 110 using JK flip-flops

Short answer

Mealy machine: states A=00 (idle), B=01 (got '1'), C=10 (got '11'). Equations: J1=Q0X, K1=X', J0=Q1'X, K0=1, Y=Q1X'. Output Y=1 when X=0 in state C, detecting 110 with overlapping sequences. Unused state 11 self-corrects.

Design a sequential machine that produces output Y = 1 when it detects the serial message X = 110 using JK flip-flop.

The machine has one serial input X and one output Y. Y = 1 when the last three bits received are 1, 1, 0.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 3 bits, 3 states are needed, so 2 JK flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 4 states.)

Step 1: States

Present stateMeaningNext (X=0)Next (X=1)Y (X=0)Y (X=1)
Areset / no useful bitsAB00
B"1" receivedAC00
C"11" receivedAC10

Step 2: State diagram

 Main path (label = X/Y):
 A -1/0-> B -1/0-> C -0/1-> A
 Other transitions:
 A -0/0-> A    B -0/0-> A
 C -1/0-> C

Step 3: State assignment

StateABC
Q1 Q00 00 11 0

Code 11 is unused and is treated as a don't care.

Step 4: Excitation table

JK excitation: 0→0: J=0, K=X; 0→1: J=1, K=X; 1→0: J=X, K=1; 1→1: J=X, K=0.

Q1 Q0XQ1+ Q0+J1K1J0K0Y
0 000 00X0X0
0 010 10X1X0
0 100 00XX10
0 111 01XX10
1 000 0X10X1
1 011 0X00X0

Step 5: K-maps (rows Q1Q_1, columns Q0XQ_0X)

J1: Q1 / Q0X00011110
00010
1XXXX
K1: Q1 / Q0X00011110
0XXXX
110XX
J0: Q1 / Q0X00011110
001XX
100XX
K0: Q1 / Q0X00011110
0XX11
1XXXX
Y: Q1 / Q0X00011110
00000
110XX

Step 6: Equations

J1=Q0X,K1=X‾J0=Q1‾X,K0=1Y=Q1X‾\begin{aligned} &J_1 = Q_0X,\quad K_1 = \overline{X} \\ &J_0 = \overline{Q_1}X,\quad K_0 = 1 \\ &Y = Q_1\overline{X} \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
J0>|J   Q|-Q0 J1>|J   Q|-Q1
   | FF0 |       | FF1 |
K0>|K    |    K1>|K    |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
X = serial input, common to the gates
J1 = Q0.X   K1 = X'
J0 = Q1'.X   K0 = 1
Y = Q1.X'

The gates for each flip-flop input are built from the equations; the output gate gives Y directly (Mealy output).

Unused state 11: with the equations above, from 11 the machine goes to 00 when X = 0 and to 10 when X = 1, so it enters the valid states after one clock. Since Y can be 1 from state 11 for one clock, the flip-flops should be cleared to 00 at power-on (reset).

Check with an input stream

X0110111010
StateAABCABCCAB
Y0001000100

Y = 1 appears exactly on the clock in which the last bit of 110 arrives; overlapping sequences are also detected.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 9 questions →