As we don't require asynchronous outputs, a Moore-Automat is enough. Either we already select this with the start of JavaFSM, or we put set in the menu "Machine".
Now, we require two inputs with the names "auf" (up) and "stop". The first one gives the counting-direction and the second stops the counter. Furthermore, we require two outputs with names "d0" and "d1".
In the menu "Machine - Machine-name" we can name the machine. Then it appears also in the title of the windows.
Using the menu "Machine - Editor" we get into the editor and edit the machine there.
First, we change to the insertmode for states with the "State"-button. With each mouse-click onto the grafic display, a new state is inserted there. In the "Move"-mode, the conditions can be arranged at will afterwards. Generate 4 states doing this.
Now we form two opposite circles of transitions, first changing to the transition-mode clicking on the "Transition"-Button and click from state to state then. The first selected state (red marks) is the start of the transition. The next clicked state it is leading to. If no state was is marked red, then the state is selected merely.
In order to be able to stop, each condition needs a transition on itself (loop). We click twice on each state.
In order to give the states meaningful names, we click on these in the "Move"-modus. As result, the options of the state are displayed in the window left below. The name can be altered in the input-field. This alteration is entered with Enter. In our example, we name the conditions " 00 ", 01 ", 10 " and " 11 ".
Furthermore, the output-values of the state can be defined in the option-field (for d0 and d1). The corresponding outputs are selected in the list and the value is selected:
Since it is a Moore-machine in this example, only "0" or "1" can be declared here. With Mealy-Automaten, it is also possible to declare more complex functions at this position.
Afterwards, the transition-conditions of the transitions are defined.
Through clicking on the transitnions (in the "Move"-mode) there appears
a corresponding input-field in the options-field.
As written above, alterations are only entered after pressing Enter.
For transitions, that proceed clockwise, we enter "auf&!stop",
for transitions, that proceeds contrary to the clock sense, we enter "!auf&!stop".
For loops, the transition-condition is "stop".
Now, we select a state as start, pressing the "Start-state"-buttonfirst and after that the state "0 ".
Additionally, it is possible to provide the machine with comments. You change to the "Comment"-mode and insert the comment. In the options-field, the comment-text can entered then and is pasted on by clicking on the "Assume"-button.
To finish, we can even test the machine with "FSMtesten" if it is correct.
Following display should occur:
("Der Automat ist fehlerfrei" = the machine has no errors)
We now change to the simulation-mode, in that we choose the menu-point "Simulation - Simulate" in the main-window. In the delta-network, the machine is visible. The current state and the momentarily active transition is marked red. Through clicking, we can alter the values of the inputs. With a click on the "Clock"-Button, the next state is calculated and the machine changes to it. The outputs assume the values defined in this state.
Through "Impulsediagram - Show" the impulse-diagram can be displayed.
To save the machine you choose "File - Save".
A file-window opens in the application, in which the filename can be entered.
You should be aware, that all files are saved in the same directory. Therefore, an unambiguous name should be chosen (username_machinename). Additionally, a password is given. This protects from overwriting through other users. An existing file can be overwritten only with the propper password. If an already used file-name with a wrong password is chosen an error occurs (file existing / wrong password).
A saved file can be loaded later through the menu "File - Load", file-name and password must be entered.
In JavaFSM it is possibe to export designed machines in VHDL and KISS. In the menu "File - Exportt" you choose the propper format. Unfortunately, Appletses have no possibility to access local files. The text is displayed in a seperat window where it can be processed by copy and paste.