Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Minimization of Automata It is very likely that problems like this will appear on midterm or final exam. Slides from Tadeusz Luba.

Similar presentations


Presentation on theme: "1 Minimization of Automata It is very likely that problems like this will appear on midterm or final exam. Slides from Tadeusz Luba."— Presentation transcript:

1 1 Minimization of Automata It is very likely that problems like this will appear on midterm or final exam. Slides from Tadeusz Luba

2 2 Minimalisation of an automaton abcdabcd ACBCA0111 BCCA–011– CBCAB0001 xSxS abcdabcd S1 –S3S4S2–111 S4–––0––– S3 S6 ––01–– S4 –S6S1S5–001 ––S2–––1– S6 S3–S2S30–01 Minimalisation of number of states We reduce the number of flip-flops Minimalization of number of states Automata are equivalent Often initial specification is not minimal

3 3 Compatibility relation on set of states S: (pairs of compatible states) Maximal compatibles (Maximal sets of compatible pairs) Selection of sets satisfying the following:  Closure condition  Completeness condition Minimalisation of FM

4 4 Basic Concepts xSxS abcdabcd 1 –342–111 2 4–––0––– 3 66––01–– 4 –615–001 5 ––2–––1– 6 3–230–01 Two internal states Si, Sj are Compatible, if for each input v they have consistent output states, and their successors are the same or compatible. Two internal states S i, S j are conditionally compatible, if their output states are consistent and for some v  V pairs of successors of S i, S j (denote S k, S l ): (S i, S j )  (S k, S l ) States Si, Sj are incompatible, if for some v  V the states of their outputs are inconsistent. States conditionally compatible Compatible states Incompatible states

5 5 Compatibility relation Because of conditional compatibility we use triangular table in all calculations Triangular table has as many cells are there are possible pairs of states.

6 6 Triangular table 2 3 4 5 1234 We fill the cells of triangular table as follows: v – if pair of states is compatible, v x – if pair of states in incompatible, x (i,j) – pair (pair of successors), if the pair is conditionally compatible. (i,j)

7 7 Triangular table – example abcdabcd 1–342–111 24–––0––– 366––01–– 4–615–001 5––2–––1– 63–230–01 2 3 4 5 6 12345 1,2; 3,5 v v vv v 3646 24 34

8 8 Triangular table - example 2  33,64,6 4  52,4  6  3,4  1,2; 3,5  12345 After filling the table we check if the pairs of incompatible states (denoted by  ) do exist as pairs of successor states. All non-crossed cells correspond to compatible pairs: If there are such pairs, they should be crossed out (i.e. denote by  ). This process should be repeated until all crosses are checked out. (1,2); (1,3); (1,5); (2,3); (2,4); (2,5); (3,5); (3,6); (4,6).

9 9 Calculating MCC After calculating the set of pairs of compatible states, we Calculate the following: Maximal sets of compatible states. Maximal classes of compatibility (MCC)...we know at least three methods to calculate MCC!

10 10...we return to the example 1,2 1,3 1,5 2,3 2,4 2,5 3,5 3,6 4,6 1,2,3 MCC: 1,2,3,5 MCC = {{1,2,3,5}, {2,4}, {3,6}, {4,6}} 1,2,5 1,3,5 2,3,5 2,4 3,6 4,6 vvvvvvvvvvvv Compatible pairs: (1,2); (1,3); (1,5); (2,3); (2,4); (2,5); (3,5); (3,6); (4,6)

11 11 Minimization Algorithm 1) Find all pairs of compatible states, 2) Calculate maximal sets of compatible states (MCC), 3) Select sets that satisfy the so-called Covering condition (a) and closure condition (b): a) Each state must be in at least one class; b) For each input symbol all succesors (next states) of each class must be included into one class.

12 12 Covering Condition - example abcdabcd 1–342–111 24–––0––– 366––01–– 4–615–001 5––2–––1– 63–230–01 MCC = {{1,2,3,5}, {3,6}, { 2,4}, 4,6}} To satisfy covering condition we should select : {1,2,3,5}, {4,6}

13 13 Closure condition - example abcdabcd 1–342–111 24–––0––– 366––01–– 4–615–001 5––2–––1– 63–230–01 For selected classes {1,2,3,5},{4,6}} we calculate their successors abcd 1,2,3,5 4,6 Closure condition is not satisfied! 4,63,62,42 361,23,5 3,6!2,4!

14 14 Condition of covering and closure – second try abcdabcd 1–342–111 24–––0––– 366––01–– 4–615–001 5––2–––1– 63–230–01 abcdabcd A1,2 B3,5 C4,6 MCC = {{1,2,3,5}, {3,6}, { 2,4}, {4,6}} Selection: abcdabcd ACBCA0111 BCCA–011– CBCAB0001 {1,2}, {3,5}, {4,6} 361,23,5 662– 43420111 011– 0001 O.K.

15 15 One more example 0101 12600 23111 3–4–0 4–5–0 53–1– 67–1– 7–8–0 8–––1 2 3 4 5 6 7 8 1234567 37 46 56 68 45 4858 vvv vv v vv v v 37

16 16 One more example continued 2 3 4 5 6 7 8 1234567 37 46 56 68 45 4858 vvv vv v vv v v 37 1,3 1,7 2,5 2,8 3,4 3,5 3,6 4,5 4,6 4,7 5,7 5,8 6,7 6,8 Compatibles: 3,4,6 4,5,7 4,6,7 1,3 1,7 6,8 MCC: 3,4,5 2,5,8

17 17 One more example continued 0101 12600 23111 3–4–0 4–5–0 53–1– 67–1– 7–8–0 8–––1 2,5,83,4,53,4,64,5,74,6,71,31,76,8  (0,S i )  (1,S i ) 2,5,8 3,4,5 3,4,6 4,5,7 4,6,7 1,3 1,7 6,8 MCC: 33– 1– – – –3 45– – –7 45–5–8 646868 7–7– – 2––3––7–2– Table of successors

18 18 One more example continued 0101 12600 23111 3–4–0 4–5–0 53–1– 67–1– 7–8–0 8–––1 2,5,83,4,53,4,64,5,74,6,71,31,76,8  (0,S i ) 33737227  (1,S i ) 145 58 464668– XSXS 0101 ACC11 BBA10 CAB00 ABC

19 19 Sequence Detector The input symbol that arises in the third pulse should be 1, when „triplet” has the form 001, and 0, when „triplet” is of a differnt form. The signal that occurs during the first and second pulse may be unspecified. 1234567 0/- 1/- 0/- 0/0 1/0 1/1 0/- 1/- 01100100110101001 - - 0 - - 1 - - 0 Design a Mealy machine with one input and one output (binary). The machine should analyze the successive „triplets” of input symbols.

20 20 Sequence detector 0/- 1/- 0/0 1 2 3 4 5 6 7 0/- 1/- 0/- 0/0 1/0 1/1 0/- 1/- 0/0 0/- 1/- 1 2 3 4 5 0/- 1/- 0/- 0/0 1/0 1/1 1/- S0101 123-- 245-- 355-- 41101 51100 S0101 123-- 245-- 367-- 41101 51100 61100 71100

21 21 Minimalisation of sequence detector XSXS 0101 1 23–– 2 45–– 3 55–– 4 1101 51100 22 4, 3 5 32 5, 3 545 41 2, 1 31 4, 1 51 5 51 2, 1 31 4, 1 51 5  1234 Many compatibles We use incompatible pairs to find MCC, since there is few of them, only two.

22 22 Minimalisation of sequence detector Incompatible pairs we write as a Boolean expression being a product of logic sums: Based on this we write the expression: (2  3) (4  5), which after multiplication obtains the form: (2  3) (4  5) = 2 4  2 5  3 4  3 5 In sequence detector the incompatibles are: (2, 3); (4, 5). Subtracting from set S = {1, 2, 3, 4, 5} of all states those sets of states that are written in separate products we obtain the family of all MCC {1, 2, 3, 4, 5} – {2, 4} = {1, 3, 5} {1, 2, 3, 4, 5} – {2, 5} = {1, 3, 4} {1, 2, 3, 4, 5} – {3, 4} = {1, 2, 5} {1, 2, 3, 4, 5} – {3, 5} = {1, 2, 4}

23 23 Minimalisation of sequence detector XSXS 0101 123-- 245-- 355-- 41101 51100 XSXS 01 135125135 134125135 125124135 124 135 MCC: {1, 3, 5}, {1, 3, 4}, {1, 2, 5}, {1, 2, 4} Transition function for all MCC We add the class {1,2,5} XSXS 0101 A 13512513500 B 12512413500 C 12412413501 XSXS 0101 ABA00 BCA00 CCA01 Classes: {1,3,5}, {1, 2, 4}, {1, 2, 5} satisfy closure and covering conditions But do not satisfy the closure condition – the next states: {1,2,5} ! Classes {1, 3, 5}, {1, 2, 4} satisfy covering condition, Minimal automaton

24 24...this is next realized XSXS 0101 ABA00 BCA00 CCA01 CLK x Y Formulation of sequence detector problem Whole synthesis process !


Download ppt "1 Minimization of Automata It is very likely that problems like this will appear on midterm or final exam. Slides from Tadeusz Luba."

Similar presentations


Ads by Google