0

Currently, I'm working on a mealy fsm that detects a 17 bit sequence 10100001010000001. Due to the length of the sequence, I'm having difficulty figuring out which state to return to when the input doesn't allow me to move on to the next state. Any suggestions ??

Tricky
  • 3,791
  • 3
  • 10
  • 23
  • 2
    You're going to have to provide more information if anyone is to be able to help you. Having said that, surely you have some kind of `IDLE` or `INIT` state in which the FSM is looking for the first `1`? Wouldn't that be the one to return to? – Matthew Taylor Feb 12 '20 at 09:36
  • 1
    And is an FSM the best way of doing this? It sounds quite complicated. How about a shift register and `=` operator? – Matthew Taylor Feb 12 '20 at 09:38

1 Answers1

0

Think about what previous pattern is satisfied when the expected pattern is not met. The FSM for a 10100001010000001 Mealy machine is shown below, in ASCII art (not sure how it will render here...)

s0-1->s1-0->s2-1->s3-0->s4-0->s5-0->s6-0->s7-1->s8-0->s9-1->s10-0->s11-0->s12-0->s13-0->s14-0->s15-0->s16-1->s17-0->s2
 |    |     |     |     |     |     |     |     |     |     |      |      |      |      |      |      |      |
 0    1     0     1     1     1     1     0     1     0     1      1      1      1      1      1      0      1
 |    |     |     |     |     |     |     |     |     |     |      |      |      |      |      |      |      |
s0    s1    s0    s1    s3    s1    s1    s0    s1    s0    s1     s3     s1     s1     s8     s1     s0     s1
Andrew
  • 1
  • 4
  • 19