Skip to main content

Sequence detector 011 using T flip-flops

Short answer

Three states A(00), B(01), C(10) detect overlapping 011. T flip-flop inputs: T1 = Q1 + Q0 X, T0 = Q0 X + Q0' X', output Z = Q1 X.

A asynchronous state machine has one bit serial input. The Y of the machine is set to be high when the input contains the message 011. Draw the state diagram for this machine and design the circuit. Use T Flip-Flop.

Since flip-flops and a clock are used, the machine is designed as a clocked (synchronous) Mealy machine; the output Y of the question is written Z (Y = Z).

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 011 arrives. Flip-flops: T.

States (what has been received so far):

  • A: reset / no useful bits (a 1 that does not follow "0", or a completed 011)
  • B: "0" received
  • C: "01" received

State diagram (Mealy)

Arc label = input/output

 A --0/0--> B --1/0--> C --1/1--> A

 A --1/0--> A  (self loop)
 B --0/0--> B  (self loop)
 C --0/0--> B

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
ABA00
BBC00
CBA01

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to B, X=1 goes to A), so it is self-starting.

Excitation table of T flip-flop

QQ+T
000
011
101
110

Transition and excitation table

Q1 Q0XQ1+ Q0+T1T0Z
0 000 1010
0 010 0000
0 100 1000
0 111 0110
1 000 1110
1 010 0101

K-maps and simplified equations

T1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       1    1

T0          X=0  X=1
Q1Q0=00       1    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       1    0

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    1
T1=Q0X+Q1T0=Q0X+Q0′X′Z=Q1X\begin{aligned} T_1 &= Q_0 X + Q_1 \\ T_0 &= Q_0 X + Q_0' X' \\ Z &= Q_1 X \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two T flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • T1T_1: a 2-input AND for Q0XQ_0 X; direct line Q1Q_1, combined in a 2-input OR gate.
  • T0T_0: a 2-input AND for Q0XQ_0 X; a 2-input AND for Q0′X′Q_0' X', combined in a 2-input OR gate.
  • ZZ: a 2-input AND for Q1XQ_1 X.

Check: input X = 0011011 gives Z = 0001001; Z = 1 at bits 4 and 7.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 9 questions →