- Asked 5/22
- 2079 Bhadra · 12 marks
- 2068 Chaitra · 12 marks
Sequence detector for 1010
Short answer
Design as an overlapping Mealy detector with two JK flip-flops. State encoding: A=00, B=01, C=10, D=11. The inputs are J1 = Q0 X', K1 = Q0 X + Q0' X'; J0 = X, K0 = X'; output Z = Q1 Q0 X'.
Design a sequential machine that has one serial input X and output Z. The machine is required to have an output Z = 1 when the input X contains the serial message 1010.
The machine has one serial input X and one output Z; Z = 1 when the last four bits received are 1, 0, 1, 0. Since no flip-flop type is specified, JK 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 JK flip-flops () are used, clocked on the positive edge. (A Moore machine would need 5 states.)
Step 1: States
| Present state | Meaning | Next (X=0) | Next (X=1) | Z (X=0) | Z (X=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | A | B | 0 | 0 |
| B | "1" received | C | B | 0 | 0 |
| C | "10" received | A | D | 0 | 0 |
| D | "101" received | C | B | 1 | 0 |
Step 2: State diagram
Main path (label = X/Z):
A -1/0-> B -0/0-> C -1/0-> D -0/1-> C
Other transitions:
A -0/0-> A B -1/0-> B
C -0/0-> A D -1/0-> B
Step 3: State assignment
| State | A | B | C | D |
|---|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 | 1 1 |
Step 4: Excitation table
JK excitation: 0→0: J=0, K=X; 0→1: J=1, K=X; 1→0: J=X, K=1; 1→1: J=X, K=0.
| Q1 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | X | 0 | X | 0 |
| 0 0 | 1 | 0 1 | 0 | X | 1 | X | 0 |
| 0 1 | 0 | 1 0 | 1 | X | X | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | X | X | 0 | 0 |
| 1 0 | 0 | 0 0 | X | 1 | 0 | X | 0 |
| 1 0 | 1 | 1 1 | X | 0 | 1 | X | 0 |
| 1 1 | 0 | 1 0 | X | 0 | X | 1 | 1 |
| 1 1 | 1 | 0 1 | X | 1 | X | 0 | 0 |
Step 5: K-maps (rows , columns )
| J1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 1 | X | X | X | X |
| K1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | X | X |
| 1 | 1 | 0 | 1 | 0 |
| J0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | X | X |
| 1 | 0 | 1 | X | X |
| K0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | 0 | 1 |
| 1 | X | X | 0 | 1 |
| Z: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 |
Step 6: Equations
Step 7: Logic diagram
+-----+ +-----+
J0>|J Q|-Q0 J1>|J Q|-Q1
| FF0 | | FF1 |
K0>|K | K1>|K |
+--^--+ +--^--+
| |
CLK---+-------------+
X = serial input, common to the gates
J1 = Q0.X' K1 = Q0.X + Q0'.X'
J0 = X K0 = X'
Z = Q1.Q0.X'
The gates for each flip-flop input are built from the equations; the output gate gives Z directly (Mealy output).
Check with an input stream
| X | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | A | B | C | D | C | D | C | D | C |
| Z | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
Z = 1 appears exactly on the clock in which the last bit of 1010 arrives; overlapping sequences are also detected.
Note: (an XNOR gate), and FF0 simply follows the input (, ).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Sequence detector for 110 · Digital Logic, chapter 9 · asked 5×
- 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 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 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 1101 FSM and VHDL · Embedded System, chapter 9
- Input/output interface unit design factors · Instrumentation II, chapter 7
- Sequence detector 1011 state diagram and VHDL · Embedded System, chapter 9