summaryrefslogtreecommitdiffstats
path: root/Bachelor/Digitaltechnik 2/SS07/P6/p6a1b.abl
diff options
context:
space:
mode:
Diffstat (limited to 'Bachelor/Digitaltechnik 2/SS07/P6/p6a1b.abl')
-rwxr-xr-xBachelor/Digitaltechnik 2/SS07/P6/p6a1b.abl41
1 files changed, 41 insertions, 0 deletions
diff --git a/Bachelor/Digitaltechnik 2/SS07/P6/p6a1b.abl b/Bachelor/Digitaltechnik 2/SS07/P6/p6a1b.abl
new file mode 100755
index 0000000..c3846ce
--- /dev/null
+++ b/Bachelor/Digitaltechnik 2/SS07/P6/p6a1b.abl
@@ -0,0 +1,41 @@
+MODULE ampel1
+TITLE 'Ampelsteuerung 1, state diagram'
+DEClARATIONS
+ clk pin 15; " I/O 0, Eingang für den Takt
+ rst pin 16; " I/O 1, Eingang für das Reset Signal
+ ce pin 17; " I/O 2, 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';
+
+" bus definition, vector, register
+ ampel = [vg,vy,vr,fg,fr];
+ states =[state0,state1];
+
+EQUATIONS
+ ampel.clk = clk;
+ states.clk = clk;
+
+STATE_DIAGRAM states;
+ State 0:
+ ampel:=17;
+ if(!rst & ce) then 1; " Bei Erfüllung der Bedingung erfolgt ein Übergang in State 1
+ else 0;
+ State 1:
+ ampel:=9;
+ if (rst) then 0;
+ else if (ce) then 2;
+ else 0;
+ State 2:
+ ampel:=6;
+ if (rst) then 0;
+ else if (ce) then 3;
+ else 0;
+ State 3:
+ ampel:=13;
+ if (rst) then 0;
+ else if (ce) then 0;
+ else 0;
+
+END
+