Forum Discussion
Altera_Forum
Honored Contributor
11 years agoThe new data type STATE_TYPE is created for a state machine. This allows you to write state machine code that transitions between states that have "meaningful" names, eg., rather than useless state names like S0, S1, S2, S3, etc, you can have WAIT_FOR_BUTTON, TURN_ON_LED, etc. When you synthesize the design to hardware, the synthesis tool can automatically decide how to encode the state registers (how many bits to use). When you simulate a state machine, the STATE_TYPE text is displayed in the simulator wave window (for Modelsim), so it makes it easier to debug your code.
Cheers, Dave