Download - Sequentinal INtro and Partition Refinement
![Page 1: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/1.jpg)
1
Synthesis of Sequential Machines
![Page 2: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/2.jpg)
2
Introduction
• Study of Two Level logic Synthesis
• Finite State Machine
• Optimization – Reducing the number of states and assign binary codes.
• Restrict on study of networks of machines.
![Page 3: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/3.jpg)
3
General Introduction
• Digital electronics Circuits• Combinational Logic Ciruits• Sequential Logic Circuits
• Combinational Logic • Basic element are Gates• Circuit Behavior: Output depends on the present input• Examples: Comparator, Arithmetic Circuits
• Sequential Logic• Basic elements are Flip Flops and Latches• Further Classified into Synchronous and Asynchronous based on
the clock.• Circuit Behavior: Output depends on the past history.• Examples: Counters, Shift Registers.
![Page 4: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/4.jpg)
4
![Page 5: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/5.jpg)
5
![Page 6: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/6.jpg)
6
Classification of FSM
• FSM Classification
• Class A Machines / Mealy Machine• Class B Machine / Moore Machine• Class C Machine • Class D Machine• Class E Machine.
We restrict to Class A and Class B Machines.
![Page 7: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/7.jpg)
7
Class A / Mealy machine
• Mealy Machine: M(S, I, O, δ, λ) but– λ: S x I → O (i.e. output depends on both
present state and present input)– for digital circuits, typically I = {0,1}m and O = {0,1}n
• In addition, (for both Moore and Mealy machines) certain states are classified as reset or initial states
• Finite automata are similar to FSM’s, but– they do not produce any outputs,– they just accept input sequences (an accepting
set of states is given).
![Page 8: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/8.jpg)
8
Class A/Mealy Machine
![Page 9: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/9.jpg)
9
![Page 10: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/10.jpg)
10
Class B /Moore Machine
• Moore Machine: is a quintuple: M(S, I, O, δ, λ)
– S: finite non-empty set of states
– I: finite non-empty set of inputs
– O: finite non-empty set of outputs
– δ: S x I → S transition (or next state) function
– λ: S → O output function (note: output only a function of present state)
![Page 11: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/11.jpg)
11
Class B /Moore Machine
![Page 12: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/12.jpg)
12
![Page 13: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/13.jpg)
13
Other Class Machine
![Page 14: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/14.jpg)
14
Simplified FSM Design Flow
Specification
State Minimization
State Encoding
Verification /Testing
Logic/Timing Optimization
![Page 15: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/15.jpg)
15
Steps Involved In Designing The FSM
1. Problem Analysis2. Defining the Black Box3. Draw the State Diagram (STG)/ASM4. Draw the state Table/Flow table5. Draw the State Transition Table6. Draw the excitation Table7. Using K-map/QM method find the output and
next state decoder function.8. Implement the design.
![Page 16: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/16.jpg)
16
Example
• Design an sequential circuit which detects the sequence 0101 continuously in the data sequence using D-FF.
• Solution:
Black Box
![Page 17: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/17.jpg)
17
Step 2 State Diagram
![Page 18: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/18.jpg)
18
State Table
![Page 19: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/19.jpg)
19
State Transition Table
![Page 20: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/20.jpg)
20
Reduction Using K-map
![Page 21: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/21.jpg)
21
Reduction Using K-map
![Page 22: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/22.jpg)
22
Reduction Using K-map
![Page 23: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/23.jpg)
23
Implementation
CLK
![Page 24: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/24.jpg)
24
Moore Machine
![Page 25: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/25.jpg)
25
Moore Machine-State Table
![Page 26: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/26.jpg)
26
Moore Machine
• Repeat the Steps as done for Mealy Machine.
![Page 27: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/27.jpg)
27
State Reduction
![Page 28: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/28.jpg)
28
State Reduction
![Page 29: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/29.jpg)
29
![Page 30: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/30.jpg)
30
![Page 31: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/31.jpg)
31
![Page 32: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/32.jpg)
32
Incompletely Specified FSM
• An FSM is incompletely specified if the next state function and/or the output functions are specified only for some combinations of inputs and present states.
![Page 33: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/33.jpg)
33
![Page 34: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/34.jpg)
34
![Page 35: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/35.jpg)
35
Finite Automata
• Similar to FSM whose task is only to declare inputs accepted or rejected.
• Classification– Deterministic– Non-deterministic
![Page 36: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/36.jpg)
36
![Page 37: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/37.jpg)
37
![Page 38: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/38.jpg)
38
State Equivalence and State Minimization
• K-equivalence– Two State Si and Sj, of Machine M are distinguishable
if and only if there exists at least one finite input sequence which can be applied to M,causes different output sequences, depending on whether Si and Sj is the initial state.
– If there exists for pair (Si,Sj) a distinguishing sequence of length k,the states in (Si,Sj) are said to be k-distinguishtable.
![Page 39: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/39.jpg)
39
Flow Table
PS NS,Z
X=0 X=1
A E,0 D,1
B F,0 B,0
C E,0 B,1
D F,0 B,0
E C,0 F,1
F B,0 C,0
![Page 40: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/40.jpg)
40
Contd..
• states A and B are 1-distinguishable, since a 1 input applied to A yields an output 1, versus an output 0 from B.
• states A and E are 3-distinguishable, since input sequence 111 applied to A yields output 100, versus an output 101 from E.
![Page 41: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/41.jpg)
41
Definition
• States Si and Sj of Machine M are said to be equivalent if and only if ,for every possible input sequence, the same output sequence will be produced regardless of whether Si and Sj is the initial state.
![Page 42: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/42.jpg)
42
Minimization Procedure
• Objective: – To describe a procedure for determining the
sets of equivalent states of as specified machine M.
![Page 43: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/43.jpg)
43
Step One
• Partition the states of M into subsets such that all states in the same subset are 1-equivalent.
• Consider the example shown
![Page 44: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/44.jpg)
44
Example
PS NS,Z
X=0 X=1
A E,0 D,1
B F,0 D,0
C E,0 B,1
D F,0 B,0
E C,0 F,1
F B,0 C,0
![Page 45: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/45.jpg)
45
Minimization Procedure
P0=(ABCDEF)
0-distinguistablility
PS NS,Z
X=0 X=1
A E,0 D,1
B F,0 D,0
C E,0 B,1
D F,0 B,0
E C,0 F,1
F B,0 C,0
![Page 46: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/46.jpg)
46
Minimization Procedure
P0=(ABCDEF) P1=(ACE)
(BDF)
• 1-equivalent• Obtained by
inspecting table and placing those states having same outputs under all inputs, in the same block.
PS NS,Z
X=0 X=1
A E,0 D,1
B F,0 D,0
C E,0 B,1
D F,0 B,0
E C,0 F,1
F B,0 C,0
![Page 47: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/47.jpg)
47
Minimization Procedure
P0=(ABCDEF) P1=(ACE)
(BDF)
P2=(ACE)(BD)(F)
• 2-equivalent• Observed iff states
are 1-equivalent.
PS NS,Z
X=0 X=1
A E,0 D,1
B F,0 D,0
C E,0 B,1
D F,0 B,0
E C,0 F,1
F B,0 C,0
![Page 48: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/48.jpg)
48
Minimization Procedure
P0=(ABCDEF)
P1=(ACE)(BDF)
P2=(ACE)(BD)(F)
P3=(AC)(E)(BD)(F)
P4=(AC)(E)(BD)(F)
PS NS,Z
X=0 X=1
A E,0 D,1
B F,0 D,0
C E,0 B,1
D F,0 B,0
E C,0 F,1
F B,0 C,0
![Page 49: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/49.jpg)
49
In General
• PK+1 partition is obtained from PK by placing in the same block of PK and whose Ii –successors for every possible Ii are also common block of PK .
![Page 50: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/50.jpg)
50
Theorem
• The equivalence partition is unique
• If two states Si and Sj of machine M are distinguishable then they are distinguishable by a sequence of length
n-1 or less ,where n is the number of states in M.
![Page 51: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/51.jpg)
51
Machine equivalence
• Two Machines M1 and M2 are said to be equivalent iff for every state in M1,there is a corresponding equivalent state in M2 and vice versa.
![Page 52: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/52.jpg)
52
Machine equivalence
P3=(AC)(E)(BD)(F)
(AC) s1
(E) s2
(BD) s3
(F) s4
![Page 53: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/53.jpg)
53
Reduced Flow Table
PS NS,Z
X=0 X=1
s1 s2,0 s3,1
s2 s1,0 s4,1
s3 s4,0 s3,0
s4 s3,0 s1,0
![Page 54: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/54.jpg)
54
![Page 55: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/55.jpg)
55
![Page 56: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/56.jpg)
56
Example
PS NS,Z
X=0 X=1
A E,0 D,1
B F,0 D,0
C E,0 B,1
D B,0 F,0
E C,0 F,1
F B,0 C,0
![Page 57: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/57.jpg)
57
State Equivalence
P1=P0={B1}={A,B,C,D,E,F}
X=0=> O0={0,0,0,0,0,0}
X=1=>O1={1,0,1,0,1,0}
P11={{A,C,E}{B,D,F}}
B1={B,D,F}
t0= {D,B,B} when x=0 => b0= {1,1,1}
t1={F,F,C} when x=1 => b1={1,1,2}
![Page 58: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/58.jpg)
58
State Equivalence
P2={{B,D},{F}}B2={A,C,E} yield no refinement.P2={{B,D},{F},{A,C,E}}For k=3 first two blocks yield no refinement
B3={A,C,E} t0={E,E,C} when x=0; b0={3,3,3}t1={D,B,F} when x=1; b1={1,1,2}P3={{B,D},{F},{A,C},{E}}
![Page 59: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/59.jpg)
59
![Page 60: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/60.jpg)
60
![Page 61: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/61.jpg)
61
![Page 62: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/62.jpg)
62
State Equivalence
• P1=P0={{A,B,C,D,E,F,G}}
• O0=(0,0,0,0,1,0,0)
• O1=(0,1,1,0,0,0,0)
• P1={{A,B,C,D,F,G},{E}} when x=0 --- 1
• P1={{A,D,E,F,G}{BC}} when x=1 ---- 2
• Refine=> 1 Intersection 2
• P1={{A,D,F,G}{B,C}{E}}
![Page 63: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/63.jpg)
63
State Equivalence
• Consider B1
• t0={E,G,E,D} b0=(3,1,3,1) when x=0
• t1={C,A,D,G} b1=(2,1,1,1) when x=1
• Pb0={{A,F}{D,G}} Pb1={{A},{D,F,G}}
• Refine P2={{A}{D,G}{F}}.
• So P2={{A}{B,C}{D,G}{E}{F}}
• IIIlarly P3={{A}{B}{C}{D}{E}{F}{G}}
![Page 64: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/64.jpg)
64
Moore Machine
![Page 65: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/65.jpg)
65
Partition for a Moore Machine
• Similar as done with Mealy Machine.• Imagine for the different inputs same output.
• P0= (3,4,5,6)(1,2,7,8)
• P1= (3,4,5,6)(1,2)(7,8)
a=(1,2) b=(3,4,5,6) c=(7,8)
![Page 66: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/66.jpg)
66
![Page 67: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/67.jpg)
67
Iterative Collapsing Approach
• Collapsed Flow table is constructed, in which each occurrence of any member of a given class as a next is replaced by its representative.
• One Checks if the partition P1 is consistent with the modified table ie all members of each equivalence class must have identical entries in the new flow table.
![Page 68: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/68.jpg)
68
Example
![Page 69: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/69.jpg)
69
Iterative Collapsed Method
• P1={{A,D,F,G},{B,C},{E}}
• We select representives A,B,E and construct the collapsed flow table.
![Page 70: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/70.jpg)
70
This is not consistent, since rows A,D,F,G are not identical, although rows D and G are and B and C are.
![Page 71: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/71.jpg)
71
Iterative Collapsed Method
• The partition is refined into
P2 = {{A},{B,C}{D,G}{E},{F}}
as before.
The next step is to collapse the original table by replacing G by block 3 representive D and C by block 2 representive B.
![Page 72: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/72.jpg)
72
This flow table is still not consistent ,since rows D,G are not identical,neither B,C.
![Page 73: Sequentinal INtro and Partition Refinement](https://reader036.vdocument.in/reader036/viewer/2022062423/55cf94c7550346f57ba44fa9/html5/thumbnails/73.jpg)
73
Iterative Collapsed Method
• At this point the partition is refined to the minimum partition ,which of course is consistent ,so
P3 = {{A},{B},{C},{D},{E},{F},{G}}