Forum Discussion
Altera_Forum
Honored Contributor
18 years ago --- Quote Start --- Hello, Examples of wrong state changes: Here the State machine changes from 1001b to 1010b which is not declared (it should change to 0100b. A change from 1001b to 1011b which is never declared!! Thanks Thomas Brunner --- Quote End --- Took a quick look; First, according to the simulation image. The state does not change from 1001b to 1010b. It chages to 0101b (5 hexadecimal as it is shown in simulation top row). Remember STATE is declared 3 DOWNTO 0. Same in the next image. It changes to 1101b (D.hex). Those states are declared. I suggest using signals instead of variables. Especially for the STATE vector. Use signals for everything that should keep their assigned value until the next time the process is evaluated. See variables as temporary storage within a process only.