Skip to main content

Machine from 4-state diagram using SR

Short answer

States are directly coded 00, 01, 10, 11. SR flip-flop equations: S1 = Q1' Q0 X, R1 = Q1 Q0 X, S0 = X', R0 = X; output Z = Q0 X' + Q1' Q0' X.

Design a synchronous sequential machine from the given state diagram. Use SR flip-flops for realization. [Figure: state diagram with four states 00, 01, 10, 11, edges labelled input/output: 00→00 on 1/1; 00→01 on 0/0; 01→01 on 0/1; 01→10 on 1/0; 10→10 on 1/0; 10→11 on 0/0; 11→11 on 0/1; 11→00 on 1/0]

The diagram is a Mealy machine with 4 states already coded as Q1Q0Q_1 Q_0 = 00, 01, 10, 11, so no extra state assignment is needed. Input X, output Z, two S-R flip-flops (Q1Q_1 = MSB). Each state stays in itself on one input value and moves to the next state on the other.

State diagram (given)

Arc label = input/output

 00 --0/0--> 01 --1/0--> 10 --0/0--> 11 --1/0--> 00

 00 --1/1--> 00  (self loop)
 01 --0/1--> 01  (self loop)
 10 --1/0--> 10  (self loop)
 11 --0/1--> 11  (self loop)

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
00010001
01011010
10111000
11110010

Excitation table of S-R flip-flop

QQ+SR
000x
0110
1001
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+S1R1S0R0Z
0 000 10x100
0 010 00x0x1
0 100 10xx01
0 111 010010
1 001 1x0100
1 011 0x00x0
1 101 1x0x01
1 110 001010

K-maps and simplified equations

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

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

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

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

Z           X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       1    0
Q1Q0=11       1    0
Q1Q0=10       0    0
S1=Q1′Q0XR1=Q1Q0XS0=X′R0=XZ=Q0X′+Q1′Q0′X\begin{aligned} S_1 &= Q_1' Q_0 X \\ R_1 &= Q_1 Q_0 X \\ S_0 &= X' \\ R_0 &= X \\ Z &= Q_0 X' + 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 S-R flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • S1S_1: a 3-input AND for Q1′Q0XQ_1' Q_0 X.
  • R1R_1: a 3-input AND for Q1Q0XQ_1 Q_0 X.
  • S0S_0: direct line X′X'.
  • R0R_0: direct line XX.
  • ZZ: a 2-input AND for Q0X′Q_0 X'; a 3-input AND for Q1′Q0′XQ_1' Q_0' X, combined in a 2-input OR gate.

Check: from 00, X = 10101 gives states 00 → 00 → 01 → 10 → 11 → 00 and Z = 10000, matching the diagram. S1R1S_1 R_1 and S0R0S_0 R_0 are never both 1.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Digital Logic chapter 9 questions →