FSM using table lookup


My question is more a general question. My assignment is to code a FSM using a table look up. We are supposed to read in from stdin. The set of input symbols are{0,1,2} The data files will appear like this.
3 (number of states)
0 1 2
0 0 1 (state transition table)
1 2 3
1
0 (state output table)
1
011210 (input string)

I am having trouble deciding how to set this up. I think i will need a 2d array with size being number of states for the transition table and an array for the output table. I know i will have to use get for the input string and convert it to a number. I'm just having trouble putting it all together.
Last edited on
Topic archived. No new replies allowed.