- Asked 7/22
- 2078 Bhadra · 10 marks
Sequence detector 1001 using SR flip-flops
Short answer
Mealy machine with 2 S-R flip-flops; states A(00), B(01), C(10), D(11). S1 = Q1' Q0 X', R1 = Q1 Q0 + X; S0 = Q1 Q0' + X, R0 = Q0 X'; Z = Q1 Q0 X.
Design a sequential machine that has one serial input X and one output Z. The machine is required to give an output z = 1 when the input X contains the message 1001. Use S-R flip-flop.
The machine has one serial input X and one output Z; Z = 1 in the clock period in which the last bit of 1001 arrives. S-R flip-flops are used.
A Mealy machine is used (output depends on the present state and the input), so fewer states are needed. Overlapping sequences are allowed: after a detection, the machine keeps the useful tail of the input.
States (what has been received so far):
- A: reset / no useful bits
- B: "1" received
- C: "10" received
- D: "100" received
State diagram (Mealy)
Arc label = input/output
A --1/0--> B --0/0--> C --0/0--> D --1/1--> B
A --0/0--> A (self loop)
B --1/0--> B (self loop)
C --1/0--> B
D --0/0--> A
State table
| Present state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | C | B | 0 | 0 |
| C | D | B | 0 | 0 |
| D | A | B | 0 | 1 |
State assignment
A = 00, B = 01, C = 10, D = 11 (flip-flop outputs ).
Excitation table of S-R flip-flop
(x = don't care)
| Q | Q+ | S | R |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | S1 | R1 | S0 | R0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | x | 0 | x | 0 |
| 0 0 | 1 | 0 1 | 0 | x | 1 | 0 | 0 |
| 0 1 | 0 | 1 0 | 1 | 0 | 0 | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | x | x | 0 | 0 |
| 1 0 | 0 | 1 1 | x | 0 | 1 | 0 | 0 |
| 1 0 | 1 | 0 1 | 0 | 1 | 1 | 0 | 0 |
| 1 1 | 0 | 0 0 | 0 | 1 | 0 | 1 | 0 |
| 1 1 | 1 | 0 1 | 0 | 1 | x | 0 | 1 |
K-maps and simplified equations
S1 X=0 X=1
Q1Q0=00 0 0
Q1Q0=01 1 0
Q1Q0=11 0 0
Q1Q0=10 x 0
R1 X=0 X=1
Q1Q0=00 x x
Q1Q0=01 0 x
Q1Q0=11 1 1
Q1Q0=10 0 1
S0 X=0 X=1
Q1Q0=00 0 1
Q1Q0=01 0 x
Q1Q0=11 0 x
Q1Q0=10 1 1
R0 X=0 X=1
Q1Q0=00 x 0
Q1Q0=01 1 0
Q1Q0=11 1 0
Q1Q0=10 0 0
Z X=0 X=1
Q1Q0=00 0 0
Q1Q0=01 0 0
Q1Q0=11 0 1
Q1Q0=10 0 0
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 outputs or from NOT gates):
- : a 3-input AND for .
- : a 2-input AND for , combined with the direct line in a 2-input OR gate.
- : a 2-input AND for , combined with the direct line in a 2-input OR gate.
- : a 2-input AND for .
- : a 3-input AND for .
Check: input X = 01001001 gives Z = 00001001; Z = 1 at the 5th and 8th bits, so both overlapping 1001s are detected.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Sequence detector 1010 using T flip-flops · Digital Logic, chapter 9 · asked 7×
- Sequence detector 1011 using JK flip-flops · Digital Logic, chapter 9 · asked 3×
- Sequence detector for 110 · Digital Logic, chapter 9 · asked 5×
- Sequence detector for 1010 · Digital Logic, chapter 9 · asked 5×
- Sequence detector 1001 using D flip-flops · Digital Logic, chapter 9 · asked 9×
- Sequence detector 1101 using SR flip-flops · Digital Logic, chapter 9 · asked 7×
- Sequence detector 110 using SR flip-flops · Digital Logic, chapter 9
- Sequence detector 1101 using T flip-flops · Digital Logic, chapter 9 · asked 7×
- Sequence detector 001 using JK flip-flops · Digital Logic, chapter 9 · asked 7×
- Sequence detector 011 using JK flip-flops · Digital Logic, chapter 9 · asked 7×
- Sequence detector 1110 using T flip-flops · Digital Logic, chapter 9 · asked 7×
- Combinational vs sequential; JK flip-flop · Basic Electronics Engineering, chapter 6
- SR flip-flop operation · Basic Electronics Engineering, chapter 6 · asked 6×
- Types of flip-flops; JK flip-flop · Basic Electronics Engineering, chapter 6 · asked 2×