- Asked 7/22
- 2079 Baisakh · 12 marks
Sequence detector 001 using JK flip-flops
Short answer
Mealy machine with 2 JK flip-flops; states A(00), B(01), C(10); unused 11 don't care. J1 = Q0 x', K1 = x; J0 = Q1' x', K0 = 1; z = Q1 x. Power-on reset required.
Design a sequential machine that has a single input 'x' and single output 'z'. The machine is required to give high output when it detects the serial sequence of 001 message. Use JK flip-flops only.
The machine has a single input x and a single output z; z = 1 when the last three bits received are 0, 0, 1. Only 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 3 bits, 3 states are needed, so 2 JK flip-flops () are used, clocked on the positive edge. (A Moore machine would need 4 states.)
Step 1: States
| Present state | Meaning | Next (x=0) | Next (x=1) | z (x=0) | z (x=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | B | A | 0 | 0 |
| B | "0" received | C | A | 0 | 0 |
| C | "00" received | C | A | 0 | 1 |
Step 2: State diagram
Main path (label = x/z):
A -0/0-> B -0/0-> C -1/1-> A
Other transitions:
A -1/0-> A B -1/0-> A
C -0/0-> C
Step 3: State assignment
| State | A | B | C |
|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 |
Code 11 is unused and is treated as a don't care.
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 1 | 0 | X | 1 | X | 0 |
| 0 0 | 1 | 0 0 | 0 | X | 0 | X | 0 |
| 0 1 | 0 | 1 0 | 1 | X | X | 1 | 0 |
| 0 1 | 1 | 0 0 | 0 | X | X | 1 | 0 |
| 1 0 | 0 | 1 0 | X | 0 | 0 | X | 0 |
| 1 0 | 1 | 0 0 | X | 1 | 0 | X | 1 |
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 | 0 | 1 | X | X |
| J0: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 1 | 0 | X | X |
| 1 | 0 | 0 | X | X |
| K0: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | 1 | 1 |
| 1 | X | X | X | X |
| z: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | X | X |
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 = x
J0 = Q1'.x' K0 = 1
z = Q1.x
The gates for each flip-flop input are built from the equations; the output gate gives z directly (Mealy output).
Unused state 11: with the equations above, from 11 the machine goes to 10 when x = 0 and to 00 when x = 1, so it enters the valid states after one clock. Since z can be 1 from state 11 for one clock, the flip-flops should be cleared to 00 at power-on (reset).
Check with an input stream
| x | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | B | C | A | B | C | A | B | C | C |
| z | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
z = 1 appears exactly on the clock in which the last bit of 001 arrives; overlapping sequences are also detected.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Sequence detector 1101 using T 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 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 110 using JK flip-flops · Digital Logic, chapter 9 · asked 3×
- Sequence detector 1011 using JK flip-flops · Digital Logic, chapter 9 · asked 3×
- Sequence detector 1011 using T flip-flops · Digital Logic, chapter 9 · asked 2×
- Sequence detector 101 using JK flip-flops · Digital Logic, chapter 9 · asked 2×
- 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×
- Combinational vs sequential; JK flip-flop · Basic Electronics Engineering, chapter 6
- Types of flip-flops; JK flip-flop · Basic Electronics Engineering, chapter 6 · asked 2×