Create a finite-state machine

465 Views Asked by At

I need to create a finite-state machine which accepts strings whose characters are in {a,b,c} and produce output strings of T's and F's. The machine outputs a T once the characters ab is encountered and outputs F's before ab is encountered.

The inserted images are two possible state-machines I have come up with so far. I think both are acceptable.

Since the state-machine is to also output F's, should the F's also be accepting states?

Thanks for any feedback.

Tony

Diagram 1

Diagram 2