- Asked 9/22
- 2078 Kartik · 12 marks
Sequence detector 1001 using D flip-flops
Short answer
Mealy machine with 2 D flip-flops; states S0(00), S1(01), S2(10), S3(11). D1 = (Q1 xor Q0) A', D0 = Q1 Q0' + A, Y = Q1 Q0 A.
A sequential machine which has one input, A and one output, Y. The machine is required to give the output high when the input contains a serial message of 1001, use only D flip-flops for realizing the design.
The machine has one input A and one output Y; Y = 1 when the last four bits received on A are 1, 0, 0, 1. Only D flip-flops are used.
A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 4 bits, 4 states are needed, so 2 D flip-flops () are used, clocked on the positive edge. (A Moore machine would need 5 states.)
Step 1: States
| Present state | Meaning | Next (A=0) | Next (A=1) | Y (A=0) | Y (A=1) |
|---|---|---|---|---|---|
| S0 | reset / no useful bits | S0 | S1 | 0 | 0 |
| S1 | "1" received | S2 | S1 | 0 | 0 |
| S2 | "10" received | S3 | S1 | 0 | 0 |
| S3 | "100" received | S0 | S1 | 0 | 1 |
Step 2: State diagram
Main path (label = A/Y):
S0 -1/0-> S1 -0/0-> S2 -0/0-> S3 -1/1-> S1
Other transitions:
S0 -0/0-> S0 S1 -1/0-> S1
S2 -1/0-> S1 S3 -0/0-> S0
Step 3: State assignment
| State | S0 | S1 | S2 | S3 |
|---|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 | 1 1 |
Step 4: Excitation table
D excitation: (D equals the next state).
| Q1 Q0 | A | Q1+ Q0+ | D1 | D0 | Y |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 1 | 0 |
| 0 1 | 0 | 1 0 | 1 | 0 | 0 |
| 0 1 | 1 | 0 1 | 0 | 1 | 0 |
| 1 0 | 0 | 1 1 | 1 | 1 | 0 |
| 1 0 | 1 | 0 1 | 0 | 1 | 0 |
| 1 1 | 0 | 0 0 | 0 | 0 | 0 |
| 1 1 | 1 | 0 1 | 0 | 1 | 1 |
Step 5: K-maps (rows , columns )
| D1: Q1 / Q0A | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 |
| D0: Q1 / Q0A | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
| Y: Q1 / Q0A | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 |
Step 6: Equations
Step 7: Logic diagram
+-----+ +-----+
D0>|D Q|-Q0 D1>|D Q|-Q1
| FF0 | | FF1 |
| | | |
+--^--+ +--^--+
| |
CLK---+-------------+
A = serial input, common to the gates
D1 = Q1.Q0'.A' + Q1'.Q0.A'
D0 = Q1.Q0' + A
Y = Q1.Q0.A
The gates for each flip-flop input are built from the equations; the output gate gives Y directly (Mealy output).
Check with an input stream
| A | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | S0 | S1 | S2 | S3 | S1 | S2 | S3 | S1 | S1 | S2 |
| Y | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 |
Y = 1 appears exactly on the clock in which the last bit of 1001 arrives; overlapping sequences are also detected.
Note: , so FF1 needs one XOR and one AND gate.
✓ 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 1001 using SR flip-flops · Digital Logic, chapter 9 · asked 7×
- Sequence detector 1101 using SR flip-flops · Digital Logic, chapter 9 · asked 7×
- 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×
- Sequence detector 1011 using T flip-flops · Digital Logic, chapter 9 · asked 2×
- Sequence detector 101 using T flip-flops · Digital Logic, chapter 9
- Sequence detector 1011 using JK flip-flops · Digital Logic, chapter 9 · asked 3×
- Sequence detector 011 using T flip-flops · Digital Logic, chapter 9
- Sequence detector 011 using RS flip-flops · Digital Logic, chapter 9