Skip to main content

Sequence detector 1110 using T flip-flops

Short answer

Four states: A(00), B(01), C(10), D(11). T flip-flop inputs: T1 = Q1 X' + Q1' Q0 X, T0 = Q0 X' + Q0' X + Q1' X, output Z = Q1 Q0 X'.

Design a sequential machine that has a single input 'X' and single output 'Z'. The machine is required to give high output when it detects the serial sequence of 1110 message. Use T-flip-flops only.

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 1110 arrives. Flip-flops: T.

States (what has been received so far):

  • A: reset / last bit 0
  • B: "1" received
  • C: "11" received
  • D: "111" received (stays in D on more 1s)

State diagram (Mealy)

Arc label = input/output

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

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

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BAC00
CAD00
DAD10

State assignment

A = 00, B = 01, C = 10, D = 11 (flip-flop outputs Q1Q0Q_1 Q_0).

Excitation table of T flip-flop

QQ+T
000
011
101
110

Transition and excitation table

Q1 Q0XQ1+ Q0+T1T0Z
0 000 0000
0 010 1010
0 100 0010
0 111 0110
1 000 0100
1 011 1010
1 100 0111
1 111 1000

K-maps and simplified equations

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

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

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       1    0
Q1Q0=10       0    0
T1=Q1X′+Q1′Q0XT0=Q0X′+Q0′X+Q1′XZ=Q1Q0X′\begin{aligned} T_1 &= Q_1 X' + Q_1' Q_0 X \\ T_0 &= Q_0 X' + Q_0' X + Q_1' X \\ Z &= Q_1 Q_0 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 Q1X′Q_1 X'; a 3-input AND for Q1′Q0XQ_1' Q_0 X, combined in a 2-input OR gate.
  • T0T_0: a 2-input AND for Q0X′Q_0 X'; a 2-input AND for Q0′XQ_0' X; a 2-input AND for Q1′XQ_1' X, combined in a 3-input OR gate.
  • ZZ: a 3-input AND for Q1Q0X′Q_1 Q_0 X'.

Check: input X = 0111101110 gives Z = 0000010001; Z = 1 at bits 6 and 10. Note D stays in D on 1, since "1111" still ends in "111".

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 9 questions →