Computer Science 516 A Little On Finite State Machines
Finite State Machines Commonly used in upper division Computer Science classes You will see them again Used in Electronic Engineering Digital Circuit Design Used in parsing for compiler writing classes Used in Huffman encoding
What is it? Basically, it’s a diagram or picture which relates the various states a process (machine) can go through as part of its execution Circles (nodes) A final node may have concentric circles Arcs (transitions)
Sample Problem: Separate a string into its individual words Step 1: Define terms: Word - 1-n characters in {A-Z, a=z} white space - 1-n characters from {space, comma, period, dash, slash, et cetera} Sentence - 1-n words and 0-n white space sequences terminated by {period, ?, !}
FSM Sample Step 2: Define states: Start Consuming white space Consuming a word End of sentence Stop
Step 3: Draw a diagram