---
title: "Mealy detector for 110 using JK"
subject: "Digital Logic"
chapter: 9
key: "semester_3/digital_logic:mealy-detector-110-jk"
source: https://www.bctengineer.com/q/semester_3/digital_logic/mealy-detector-110-jk
site: BCT Engineering
---

# Mealy detector for 110 using JK

Digital Logic · Chapter 9: Sequential Machines

- Asked in: 2082 Shrawan, 10 marks
- Video: [State Diagram and State Table for Sequence detector using Mealy Model (Overlapping Type)](https://www.youtube.com/watch?v=5wceSNz0TAE) — WIT Solapur - Professional Learning Community
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/digital_logic/mealy-detector-110-jk
- Whole chapter: https://www.bctengineer.com/md/semester_3/digital_logic/chapter-9

## Question

Using Mealy circuit with JK flip-flops design a synchronous sequence detector that produces output Z = 1 when it detects the serial input X = 110.

## Short answer

Use three states A(00), B(01), C(10) for a Mealy machine detecting overlapping 110. With JK flip-flops: J1 = Q0 X, K1 = X', J0 = Q1' X, K0 = 1, output Z = Q1 X'.

## Answer

A **Mealy** machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of **110** arrives. Flip-flops: **J-K**.

States (what has been received so far):

- **A**: reset / last bit 0
- **B**: "1" received
- **C**: "11" received (stays in C on more 1s)

#### State diagram (Mealy)

```text
Arc label = input/output

 A --1/0--> B --1/0--> C --0/1--> A

 A --0/0--> A  (self loop)
 B --0/0--> A
 C --1/0--> C  (self loop)
```

#### State table

| Present state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | A | C | 0 | 0 |
| C | A | C | 1 | 0 |

#### State assignment

A = 00, B = 01, C = 10 (flip-flop outputs $Q_1 Q_0$). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to A, X=1 goes to C), so it is self-starting.

#### Excitation table of J-K flip-flop

| Q | Q+ | J | K |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | x |
| 1 | 0 | x | 1 |
| 1 | 1 | x | 0 |

#### Transition and excitation table

| 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 | 0 0 | 0 | x | x | 1 | 0 |
| 0 1 | 1 | 1 0 | 1 | x | x | 1 | 0 |
| 1 0 | 0 | 0 0 | x | 1 | 0 | x | 1 |
| 1 0 | 1 | 1 0 | x | 0 | 0 | x | 0 |

#### K-maps and simplified equations

```text
J1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       x    x

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

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

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

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
```

$$
\begin{aligned} J_1 &= Q_0 X \\ K_1 &= X' \\ J_0 &= Q_1' X \\ K_0 &= 1 \\ Z &= Q_1 X' \end{aligned}
$$

#### Logic diagram

```text
           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+
```

Gates needed (two J-K flip-flops with a common clock; complements are taken from the $Q'$ outputs or NOT gates):

- $J_1$: a 2-input AND for $Q_0 X$.
- $K_1$: direct line $X'$.
- $J_0$: a 2-input AND for $Q_1' X$.
- $K_0$: tied to logic 1.
- $Z$: a 2-input AND for $Q_1 X'$.

**Check:** input X = 1110110 gives Z = 0001001; Z = 1 at bits 4 and 7.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. After 110 is detected (C --0/1--> A), why does the machine go to A?
   A. The trailing 0 is not the start of a useful tail, since 110 begins with 1
   B. Because overlap is not allowed
   C. Because C is a reset state
   D. Because Z must be cleared by hardware
   Answer: A. The last bit 0 cannot start a new 110, so no useful tail remains and the machine returns to A. (Key point: After detection)

2. Which J-K inputs are needed for a flip-flop going from 0 to 1?
   A. J = 0, K = x
   B. J = 1, K = x
   C. J = x, K = 1
   D. J = x, K = 0
   Answer: B. A 0 to 1 change needs J = 1; K can be anything (x). (Key point: J-K excitation)

3. Which set of equations was found?
   A. J1 = Q0 X', K1 = X, J0 = Q1' X', K0 = 1
   B. J1 = Q1 X, K1 = X, J0 = Q0 X, K0 = 0
   C. J1 = Q0 X, K1 = X', J0 = Q1' X, K0 = 1
   D. J1 = X, K1 = 1, J0 = X', K0 = 0
   Answer: C. Reading the K-maps gives J1 = Q0 X, K1 = X', J0 = Q1' X, K0 = 1, Z = Q1 X'. (Key point: Equations)

4. For X = 1110110, at which bits is Z = 1?
   A. Bits 3 and 6
   B. Bits 4 and 6
   C. Bit 7 only
   D. Bits 4 and 7
   Answer: D. Z = 0001001, so Z = 1 where each 110 ends, at bits 4 and 7. (Key point: Check)

## Close variants set in other exams

- [Mealy detector for 010 using JK](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Amealy-detector-010-jk) — Digital Logic, chapter 9, asked 2×

## Related in Digital Logic

- [Sequence detector 110 using JK flip-flops](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Adetector-110-jk) — Digital Logic, chapter 9, asked 3×
- [Sequence detector 001 using JK flip-flops](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Adetector-001-jk) — Digital Logic, chapter 9, asked 7×
- [Sequence detector 011 using JK flip-flops](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Adetector-011-jk) — Digital Logic, chapter 9, asked 7×
- [Sequence detector 110 using SR flip-flops](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Adetector-110-sr-msb) — Digital Logic, chapter 9
- [Sequence detector 1101 using T flip-flops](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Adetector-1101-t) — Digital Logic, chapter 9, asked 7×
- [Sequence detector 1110 using T flip-flops](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Adetector-1110-t) — Digital Logic, chapter 9, asked 7×

## Related in other subjects

- [VHDL entity declaration; T flip-flops circuit](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Avhdl-entity-two-tff-inverter) — Embedded System, chapter 9
- [Types of flip-flops; JK flip-flop](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Aflip-flop-types-jk) — Basic Electronics Engineering, chapter 6, asked 2×
