Home › Practice › RTL Design › Sequence detector: 1101 (Mealy, overlapping)
Sequence detector: 1101 (Mealy, overlapping)
MediumRTLFSM
Detect the serial pattern 1101 on din, one bit per rising edge, oldest bit first. Build it as a Mealy machine, and it is overlapping: 1101101 contains two matches.
hitis combinational from the stored history and the currentdin(Mealy): it is 1 in the cycle wheredinis the final1and the three bits sampled before it were110.rstis synchronous, active-high. Bits sampled before reset do not count. Whilerst=1,hitis 0.
Example: din = 1 1 0 1 1 0 1 gives hit = 0 0 0 1 0 0 1 in the same cycles (no one-cycle delay).
No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.