• No results found

State Diagrams. Last updated 7/13/20

N/A
N/A
Protected

Academic year: 2021

Share "State Diagrams. Last updated 7/13/20"

Copied!
21
0
0

Loading.... (view fulltext now)

Full text

(1)

State Diagrams

(2)

2 © tj CE 1911

State Diagrams

These slides review the basics of Finite State

Machines and State Diagrams

Upon completion: You should be able to develop an

efficient state diagram for an FSM

(3)

3 © tj CE 1911

State Diagrams

• Finite State Machine

• State Diagram – Moore

• State • Outputs • Inputs S123 100110 In1

(4)

4 © tj CE 1911

State Diagrams

• Finite State Machine

• State Transition Diagram – Moore

• Transitions ONLY occur on clock edges (rising) • Transitions occur on EVERY clock edge (rising)

• Priority stop light – Inputs: Reset, Traffic N/S, Traffic E/W

• State 0 : NS light state variable (memory) holds code for green EW light state variable (memory) holds the code for red

• State 1 : NS light state variable (memory) holds code for yellow EW light state variable (memory) holds the code for red

ST0 NS: green EW: red ST1 NS: yellow EW: red

(5)

5 © tj CE 1911

State Diagrams

• Finite State Machine

• State Transition Diagram – Moore

• Transitions ONLY occur on clock edges (rising) • Transitions occur on EVERY clock edge (rising)

• Priority stop light – Inputs: Reset, Traffic N/S, Traffic E/W

ST0 NS: green EW: red ST1 NS: yellow EW: red ST3 NS: red EW: yellow ST2 NS: red EW: green

(6)

6 © tj CE 1911

State Diagrams

• Finite State Machine

• State Transition Diagram – Moore

• Transitions ONLY occur on clock edges (rising) • Transitions occur on EVERY clock edge (rising)

• Priority stop light – Inputs: Reset, Traffic N/S, Traffic E/W • Basic transitions ST0 NS: green EW: red ST1 NS: yellow EW: red ST3 NS: red EW: yellow ST2 NS: red EW: green

If we did not sense for traffic – this would be complete

(7)

7 © tj CE 1911

State Diagrams

• Finite State Machine

• State Transition Diagram – Moore

• Transitions ONLY occur on clock edges (rising) • Transitions occur on EVERY clock edge (rising)

• Priority stop light – Inputs: Reset, Traffic N/S, Traffic E/W

ST0 NS: green EW: red ST1 NS: yellow EW: red ST3 NS: red EW: yellow ST2 NS: red EW: green TNS TEW TNS TEW

(8)

8 © tj CE 1911

State Diagrams

• Finite State Machine

• State Transition Diagram – Moore

• Transitions ONLY occur on clock edges (rising) • Transitions occur on EVERY clock edge (rising)

• Priority stop light – Inputs: Reset, Traffic N/S, Traffic E/W

ST0 NS: green EW: red ST1 NS: yellow EW: red ST3 NS: red EW: yellow ST2 NS: red EW: green reset TNS TEW TNS TEW

(9)

9 © tj CE 1911

State Diagrams

• Timed FSMs

ST0 output 0 ST1 output 1 ST3 output 3 ST2 output 2 reset in1 t ≤ tdelay1 in1 t > tdelay1 in1 and (t ≤ tdelay2)

in1 or (t > tdelay2)

conditional transition

unconditional transition

timed transition combination transition

(10)

10 © tj CE 1911

State Diagrams

• Finite State Machine

• Hardware Design Process

1) Identify the states – collectively these make a state variable 2) Identify the Inputs and Outputs

3) Assign values for each input/output (encoding) 4) Create a state transition diagram / table

5) Assign values for the state variable for each state (encoding) 6) Create truth tables for the combinational logic blocks in the

machine model: next state, output

7) Minimize the next state and output equations using K-maps or Boolean Algebra techniques

8) Draw the circuit schematic 9) Verify the solution

10) Build the physical circuit

(11)

11 © tj CE 1911

State Diagrams

• Finite State Machine

• HDL Design Process

1) Identify the states – collectively these make a state variable 2) Identify the Inputs and Outputs

3) Create a state transition diagram

4) Name each state (create an enumerated type) 5) Code the state diagram using the FSM construct

1) Next State Logic 2) Register Update 3) Output logic

6) Verify the solution

7) Build the physical circuit

(12)

12 © tj CE 1911

State Diagrams

• Un-used states

• Do we care about un-used states?

• YES!

• Start-up

• Bit errors

(13)

13 © tj CE 1911

State Diagrams

• Un-used states

• Mod 5 counter

000 010 100 011 001 101 110 111 reset

(14)

14 © tj CE 1911

State Diagrams

• Un-used states

• Mod 5 counter

• What happens if an event causes the state to become

corrupted

000 010 100 011 001 101 110 111 reset

(15)

15 © tj CE 1911

State Diagrams

• Un-used states

• Mod 5 counter

• Recovery solution

000 010 100 011 001 101 110 111 reset

(16)

16 © tj CE 1911

State Diagrams

• Un-used states

• Mod 5 counter

• Recovery solution

000 010 100 011 001 101 110 111 reset

(17)

17 © tj CE 1911

State Diagrams

• Un-used states

• Mod 5 counter

• self starting – reset not required

000 010 100 011 001 101 110 111 reset

(18)

18 © tj CE 1911

State Diagrams

• Redundant / Equivalent States

• Redundant states lead to more logic than necessary

• 2 States are equivalent if

• Outputs are the same

(19)

19 © tj CE 1911

State Diagrams

• Redundant / Equivalent States

• Informal analysis

• 3 state variables

• 3 output bits

A 100 C 110 E 101 D 101 B 010 x’y’ x+y x+y x’y’ x x’y x’y’ y y y’ y’

(20)

20 © tj CE 1911

State Diagrams

• Redundant / Equivalent States

• Informal analysis

• States D and E

• have the same output (101) • both go to C when y is true • both go to D when y’ is true

(21)

21 © tj CE 1911

State Diagrams

• Redundant / Equivalent States

• Informal analysis

• Redundant states lead to more logic than necessary

• 3 state variables → 2 state variables

• 3 output bits → re-encoded to 2 bits

A 100 C 110 DE 101 B 010 x’y’ x+y x+y x’y’ x x’y x’y’ y y’ 00 01 10 11

References

Related documents

Interestingly, the highest cold hardiness involving the lowest percentage of completely frozen buds at the third testing date (February) was observed in Early Muscat and

2.4 REF and SF complete samples for clustering analysis In order to investigate the clustering properties of star forming galaxies with respect to optical luminosity and stellar mass

En el análisis de los conflictos entre política y moralidad encontramos uno de los temas en los que se pone de manifiesto la gran coincidencia de Arendt con Max Weber no solo sobre

‣ You have to accept some risk in order to get benefit ‣ Will encourage people to use only safe technology • Q: What’s in your browser?.. Risk 10 - Why are we

Since there is less task-relevant visual information to be processed for the lower intensity expressions, we expected that even at the informative facial features such as the

Additional information concerning factors that could cause actual results to differ materially from those in the forward-looking statements is contained from time

A meticulous review of the ERP implementation and assimilation literature would suggest that the technology-organisation-environment (TOE) framework (Tornatzky and Fleischer, 1990)

Akerlof and Miyazaki (1980) have criticized the implicit contract model on similar grounds, demonstrating theoretically that firms can exploit workers’ risk aversion by keeping