FSM Structures - PowerPoint PPT Presentation

About This Presentation
Title:

FSM Structures

Description:

Mealy, Moore and Combined Mealy/Moore outputs. Figure 8.3. 2. EDA Lab. ... State diagram implying sequential output logic. 82. EDA Lab. ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 159
Provided by: char119
Category:

less

Transcript and Presenter's Notes

Title: FSM Structures


1
FSM Structures
  • Mealy, Moore and Combined Mealy/Moore outputs
  • Figure 8.3

2
(No Transcript)
3
Bad FSM Model
  • State Diagram

4
VHDL Code
5
Contd
6
Problems of FSM1 BAD
  • no reset, no next state value defined for the
    unused state.
  • 2bits FFs 3 states used, one unused state.
  • Read and Write output assignment infer extra two
    FFs.
  • To avoid extra FFs, use separate combinational
    process.
  • variable initialization
  • Ignored by the synthesis tools.

7
FSM1_GOOD
8
(No Transcript)
9
Synthesized Circuit
10
FSM 2
  • State Diagram

11
VHDL Code (Bad)
12
Contd
  • Output Y
  • Assigned under clockevent statement.
  • Extra FFs are inferred.

13
Good Model 1 (1 sequential process, 1 combination
process, selected signal assignment for Y)
14
Contd
15
Sequential process Combinational process
  • Sequential process
  • Description with respect to the edge point
  • Input sampled just before the edge
  • Output
  • Combinational process

input
output
input
output
16
FSM 2_GOOD2
  • Combined current state and next state logic
  • Separate output logic

17
Separate output logic
18
Contd
19
Synthesized Circuit
20
FSM 2_GOOD3
  • Combined next state and output logic
  • Separate current state logic

21
VHDL Code
22
(No Transcript)
23
FSM 2_GOOD4
  • Combined current state, next state and output
    logic

24
VHDL Code
25
(No Transcript)
26
Car Speed Controller FSM
  • State Diagram

27
Input primary branch directives
28
(No Transcript)
29
State value primary branch directives
30
(No Transcript)
31
Contd
32
Angular Position FSM using Gray and Johnson state
encoding
  • State Diagram

33
Contd
  • Input
  • Physical Position asynchronous input(loaded when
    reset 1)
  • MOVE CW 45 clock wise move
  • MOVE CCW 45 counter clock wise move
  • Two ways of representing state encoding
  • Use a signal of an enumerated type for which a
    single synthesis specific attribute is applied.
    Attribute name is specific to the synthesis tool,
    not portable, needs to be changed.

34
VHDL Code
35
Contd
  • 2. Use constants to represent the individual
    state values. It is directly portable to other
    synthesis tools.

36
(No Transcript)
37
Angular position FSM
38
Contd
39
Contd
40
Contd
41
Contd
42
Black Jack Game Machine
  • Blackjack Game
  • Blackjack is the most popular of the card games
    played at the tables in casinos. It is played
    with a standard deck of 52 cards. The four suits
    spades, hearts, diamonds and clubs have no
    significance and are ignored. The Jack, Queen and
    King all have a value of 10. The ace is the most
    powerful card having a value of 1 or 11 depending
    upon what the player chooses.
  • Blackjack is also known as pontoon or 21
    because 21 is the highest rated total card value
    a player can hold. Blackjack is the name given to
    the strongest hand consisting of an ace and a 10
    valued card.
  • The object of the game is to beat the dealer. The
    dealer has no object other than to follow the
    rules of the casino, which is to stand(hold) on
    hands of 17 or more, and to draw another card on
    hands of 16 or less.
  • A player looses if his or her total card value is
    less than the dealers total, or, he or she has
    over 21 and so has bust. If a player wants to
    improve his hand he can ask the dealer for
    another card. This is called drawing or hitting.
    If satisfied with the total card value he can
    stand(hold).

43
(No Transcript)
44
(No Transcript)
45
(No Transcript)
46
VHDL package defining four enumerated state
encoding data types
47
(No Transcript)
48
FSM with selectable state encoding Blackjack
game machine
49
Contd
50
Contd
51
Contd
52
Contd
53
Contd
54
Contd
55
Contd
56
Contd
57
Contd
58
Contd
59
Contd
60
Contd
61
FSMs with a Mealy or Moore output
  • State Diagram for FSMs with a Mealy and Moore
    output

62
(No Transcript)
63
FSM modeled with NewColor as a Mealy type output
64
Contd
65
Contd
66
Contd
67
FSM modeled with NewColor as a Moore type output
68
Contd
69
Contd
70
FSM modeled with a Mealy and a Moore Output
71
Contd
72
Contd
73
Contd
  • Moore Output
  • Dependent only on the current state, early output.

74
FSM with sequential next state logic
  • Extra FF in the next state logic.
  • State Diagram
  • BeenlnState3B (extra FF)

75
(No Transcript)
76
FSM with sequential next state logic
77
Contd
78
Contd
79
Contd
80
Contd
  • Inferred FSM Structure with an additional FF in
    the next state logic

81
FSM with sequential output logic
  • FSM with sequential output logic
  • State machine with an embedded counter
  • Counter parts of the state machines output
    logic.
  • State diagram implying sequential output logic

82
State diagram implying sequential output logic
83
FSM with sequential output logic
84
Contd
85
Contd
Tried to use a synchronized value ?? ??
86
Inferred FSM Structure with embedded counter
87
FSM with sequential next state and output logic -
Blackjack
  • Figure 8.12 State Diagram
  • VHDL coded with one single process statement.

88
VHDL Code
89
Contd
90
Contd
91
Contd
92
Contd
93
Contd
94
Contd
95
Interactive State Machine
  1. Unidirectional

96
(No Transcript)
97
Interactive State Machine
  • 2. Bidirectional

98
(No Transcript)
99
Unidirectional interactive FSMs
  • Three different ways of controlling data path
    with unidirectional interactive FSMs

100
(No Transcript)
101
Data Path
  • Data Path
  • Accepts three or four 4-bits values on the input.
  • Processes them, to provide sequences of either
    two or three, 9-bits values on the output.
  • Input data A, B, C, D
  • Output data Y1, Y2, Y3, (Y4)
  • When ThreeOnly 0
  • Y1 A.B A.C
  • Y2 A.D B.C
  • Y3 B.D C.D
  • When ThreeOnly 1
  • Y1 A.B A.C
  • Y4 B.C
  • Data Path controlled from Control Path 1, 2, 3

102
(No Transcript)
103
Control Path 1
  • Control Path
  • FSM master
  • send Start FSM1, Start FSM2, Start FSM3
  • FSM 1
  • Dedicated to provide four enable signals used to
    clock the serial input data into the appropriate
    holding register.
  • FSM 2
  • Send select signals which of the two held inputs
    to multiply together.
  • Provide enable signals used to clock the
    multiplied result into the appropriate state
    register.
  • FSM 3
  • Simply provide the select lines used to select
    which result to output.

104
Contd
  • Control Signals in control path 1

105
Contd
  • Master FSM state diagram and FSM1, FSM2, FSM3
    state diagram

106
Contd
107
Control Path 2
  • Three state diagram

108
Contd
  • Control Path state diagram

109
1. Data path(VHDL Code)
110
Contd
111
Contd
112
Contd
113
2. Control Path 1(VHDL Code)
114
Contd
115
Contd
116
Contd
117
Contd
118
Contd
119
Contd
120
Contd
121
Contd
122
Contd
123
Contd
124
Contd
125
Contd
126
3. Control Path 2 (VHDL Code)
127
Contd
128
Contd
129
Contd
130
Contd
131
Contd
132
Contd
133
Contd
134
Contd
135
Contd
136
4. Control Path 3 (VHDL Code)
137
Contd
138
Contd
139
Contd
140
Contd
141
Contd
142
Contd
143
Contd
144
Two Interactive FSM Controlling rotors
  • Two Interactive FSM Controlling rotors
  • To control two mechanical interlocking rotors,
    which rotate in 90 increments in a clockwise or
    counter clockwise.

145
(No Transcript)
146
Contd
  • Two Interactive FSM Controlling rotors
  • FSM1(FSM2) controls the rotor R1(R2)
  • Four states(Ang0, Ang90, Ang180, Ang270)
  • Inputs CW-R1, CCW-R1, CW-R2, CCW-R2
  • Two rotors should not be in the same position
  • Primary drive, Secondary drive
  • Cannot be in or moved to some where if it is not
    occupied by the primary drive
  • R1_R2b 1 R1 is drive
  • R1_R2b 0 R2 is drive

147
(No Transcript)
148
VHDL Code
149
Contd
150
Contd
151
Contd
152
Contd
153
Contd
154
Contd
155
Contd
156
Contd
157
Contd
158
Contd
Write a Comment
User Comments (0)
About PowerShow.com