State |
Encodedin binary
| Explanation |
init | 0000 | Initial, starting state. FunCPU remains in this state until it determines the lenght of the input expression |
start | 0001 | Start phase is entered upon each reduction cycle. FunCPU decides if the expression is reduced, or the reduction process should continue. |
copy | 0010 | In this state FunCPU copies one symbol after another from the source expression to the target. |
inc | 0011 | Increment function is being executed. |
dec | 0100 | Decrement function is being executed. |
if-in | 0101 | if-then-else function is found. If the condition is constant, then the appropriate branch state is reached. |
if-then | 0110 | Condition was true, the "then" part is selected. |
if-skip-else | 0111 | Condition was true, the "else" part must be ignored. |
if-else | 1000 | Condition was false, the "else" part must be selected. |
if-skip-then | 1001 | Condition was false, the "then" part is ignored. |
func-in | 1010 | User defined function entry. In this state the FunCPU checks, if all the arguments are available as constant, thus the function can be executed. Otherwise the function reduction is postponed. |
func-copy | 1011 | FunCPU is unfolding the function definition and performing argument binding. |
err-iin | 1100 | Some unexpected condition is encountered, most probably due to some hardware error or error in micro-program. Program execution is aborted. |
err-arg | 1101 | Function with less argument is found, than expected. Program execution is aborted. |
err-empty | 1110 | Empty expression or function definition is found. Program execution is aborted. |
stop | 1111 | Input expression has been succesfully calculated. The processor will idle its final state and the result value is observable by looking at the data LEDs. |
2015-05-23
FunCPU - Internal States and State Diagram
Subscribe to:
Posts (Atom)