automatul programabil AP MICRO Exemplu S" se realizeze sinteza unui automat secven!ial sincron prev"zut cu o singur" linie de intrare, T, patru linii de ie#ire, E 3 , E 2 , E 1 , E 0 , #i descris prin coresponden!a intrare - ie#ire: T 0 1 0 1 0 1 0 1 Z 0 1 3 7 17 7 3 1 Observa!ii: ! Combina!iile de semnale de ie"ire sunt scrise n codificare octal#, Z = E 3 E 2 E 1 E 0 (E 0 = LSB) ! Sistemul va avea o func!ionare ciclic#. 1. Diagrama de semnale #i alocarea variabilelor St#rile automatului secven!ial vor fi materializate prin loca!iile de memorie binar# M0 - M7. n diagrama de semnale s-a eviden!iat func!ionarea ciclic# a automatului, dup# starea M7 urmnd din nou starea M0. Semnalul de comand# T se transmite prin canalul de intrare I0. Se observ# c# acest semnal este activ att pe frontul pozitiv (trecere la 1), ct "i pe cel negativ (trecere la 0). Ie"irea automatului se transmite n exterior prin canalele de ie"ire: E3, E2, E1, E0. S-a prev#zut un buton de ini!ializare (aplicat prin canalul de intrare I1) la ap#sarea c#ruia se realizeaz# aducerea automatului n starea ini!ial# (M0 = 1). I 0 E 3 E 2 E 1 E 0 t t t t t M 0 M 1 M 2 M 3 M 4 M 5 M 6 M 7 M 0 INTR$RI I0 T Semnal de comand# I1 BI Buton de ini!ializare IE%IRI E0 E1 E2 E3 Z Ie"ire automat (4 linii) - 2 - 2. Reprezentarea func!ion"rii automatului (graful de tranzi!ii) 3. Func!iile de ie#ire E3 = M4 E2 = M3 + M4 + M5 E1 = M2 + M3 + M4 + M5 + M6 E0 = M1 + M2 + M3 + M4 + M5 + M6 + M7 4. Organizarea general" a programului I - Program de Ini!ializare A - Program Automat E - Program de activare Ie"iri 5. Programul n limbaj literal Adr.MP Opera!ie Operand Comentariu 0000 LD I1 1 JC 0035 Salt la Ini!ializare 2 LD M0 3 AND I0 4 S M1 5 R M0 Lansare automat dup# ini!ializare; Trecere M0 - M1 M2 M0 M1 M3 M4 M5 M6 M7 I0 I0 I0 I0 I0 I0 I0 I0 I1 RUN A I I1 1 0 J 0 E - 3 - 6 LD M1 7 ANDC I0 8 S M2 9 R M1 Trecere M1 - M2 0010 LD M2 1 AND I0 2 S M3 3 R M2 Trecere M2 - M3 4 LD M3 5 ANDC I0 6 S M4 7 R M3 Trecere M3 - M4 8 LD M4 9 AND I0 0020 S M5 1 R M4 Trecere M4 - M5 2 LD M5 3 ANDC I0 4 S M6 5 R M5 Trecere M5 - M6 6 LD M6 7 AND I0 8 S M7 9 R M6 Trecere M6 - M7 0030 LD M7 1 ANDC I0 2 S M0 3 R M7 4 J 0043 Trecere M7 - M0; func!ionare ciclic# 5 S M0 6 R M1 7 R M2 8 R M3 9 R M4 0040 R M5 1 R M6 2 R M7 Program de Ini!ializare 3 LD M4 4 STO E3 5 LD M3 6 OR M4 7 OR M5 8 STO E2 9 LD M2 0050 OR M3 1 OR M4 2 OR M5 3 OR M6 4 STO E1 Program de activare canale de Ie"ire - 4 - 5 LD M1 6 OR M2 7 OR M3 8 OR M4 9 OR M5 0060 OR M6 1 OR M7 2 STO E0 3 J 0000 Buclare program