MODULE ampel2 TITLE 'Ampelsteuerung 1, state diagram' DEClARATIONS clk pin 15; " I/O 0, Eingang für den Takt taste pin 18 istype 'reg'; " I/O 3, Eingang für das Enable Signal vg,vy,vr,fg,fr pin 25,26,27,28,29 istype 'reg'; " I/O 8,9,10,11,12 state0 node istype 'reg'; state1 node istype 'reg'; state2 node istype 'reg'; tmp_taste node istype 'reg'; " bus definition, vector, register ampel = [vg,vy,vr,fg,fr]; states =[state0,state1,state2]; EQUATIONS ampel.clk = clk; states.clk = clk; tmp_taste.clk=clk; tmp_taste.aset=taste; tmp_taste.d=0; STATE_DIAGRAM states; State 0: ampel:=17; if(tmp_taste == 1) then 1; " Bei Erfüllung der Bedingung erfolgt ein Übergang in State 1 else 0; State 1: ampel:=9; goto 2; State 2: ampel:=5; goto 3; State 3: ampel:=6; goto 4; State 4: ampel:=6; goto 5; State 5: ampel:=5; goto 6; State 6: ampel:=13; goto 0; State 7: ampel:=0; goto 0; END