Skip to main content

Sequence detector 110 using SR flip-flops

Short answer

Mealy machine, input MSB first: states A (reset), B (1 received), C (11 received). SR flip-flops, assignment A=00, B=01, C=10. Equations: S1 = Q0 X, R1 = X', S0 = Q1' Q0' X, R0 = Q0. Output Z = Q1 X'.

Design a synchronous state machine with the following specification: a) No. of input: 1 b) No. of output: 1 c) The output of the machine is to be set high when the data in the input is 110 in sequence, starting from the MSB (Use SR flip-flop).

"Starting from the MSB" means the bits arrive serially in the order 1, 1, 0 (MSB first).

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 110 arrives. Flip-flops: S-R.

States (what has been received so far):

  • A: reset / last bit 0
  • B: "1" (first bit, MSB) received
  • C: "11" received

State diagram (Mealy)

Arc label = input/output

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

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

State table

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

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 A, X=1 goes to C), so it is self-starting.

Excitation table of S-R flip-flop

QQ+SR
000x
0110
1001
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+S1R1S0R0Z
0 000 00x0x0
0 010 10x100
0 100 00x010
0 111 010010
1 000 0010x1
1 011 0x00x0

K-maps and simplified equations

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

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

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

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

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
S1=Q0XR1=X′S0=Q1′Q0′XR0=Q0Z=Q1X′\begin{aligned} S_1 &= Q_0 X \\ R_1 &= X' \\ S_0 &= Q_1' Q_0' X \\ R_0 &= Q_0 \\ Z &= Q_1 X' \end{aligned}

Logic diagram

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

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

  • S1S_1: a 2-input AND for Q0XQ_0 X.
  • R1R_1: direct line X′X'.
  • S0S_0: a 3-input AND for Q1′Q0′XQ_1' Q_0' X.
  • R0R_0: direct line Q0Q_0.
  • ZZ: a 2-input AND for Q1X′Q_1 X'.

Check: input X = 0110110 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 →