statechart_fig10_counter.xml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0" ?>
  2. <statechart>
  3. <inport name="in">
  4. <event name="tk0"/>
  5. <event name="reset"/>
  6. </inport>
  7. <outport name="out">
  8. <event name="done"/>
  9. </outport>
  10. <root>
  11. <parallel id="Counter">
  12. <state id="Bit_1" initial="Bit_11">
  13. <state id="Bit_11">
  14. <transition event="tk0" target="../Bit_12"/>
  15. </state>
  16. <state id="Bit_12">
  17. <transition event="tk0" target="../Bit_11">
  18. <raise event="tk1"/>
  19. </transition>
  20. </state>
  21. </state>
  22. <state id="Bit_2" initial="Bit_21">
  23. <state id="Bit_21">
  24. <transition event="tk1" target="../Bit_22"/>
  25. </state>
  26. <state id="Bit_22">
  27. <transition event="tk1" target="/Counter/Status/Max">
  28. <raise event="done"/>
  29. </transition>
  30. </state>
  31. </state>
  32. <state id="Status" initial="Counting">
  33. <state id="Counting"/>
  34. <state id="Max">
  35. <transition event="reset" target="../Counting"/>
  36. </state>
  37. </state>
  38. </parallel>
  39. </root>
  40. </statechart>