Home › Practice › RTL Design › Sequence detector: 110 (Moore, non-overlapping)
Sequence detector: 110 (Moore, non-overlapping)
MediumRTLFSM
Detect the serial pattern 110 on din, one bit per rising edge, oldest bit first. Build it as a Moore machine, and it is non-overlapping: after a match the detector starts looking again from scratch, with the next bit as the first bit of a new pattern.
hitcomes from stored state only (Moore): it is 1 during the cycle right after the edge that sampled the final0of a match, and 0 otherwise.rstis synchronous, active-high. After resethit=0and no earlier bits count.
Example: din = 1 1 0 1 1 0 gives hit = 0 0 0 1 0 0 in the cycles after each edge, then 1 again in the cycle after the sixth edge. din = 1 1 1 0 matches too: only the last three bits count.
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.