Finite state machines

2,539 views

Published on

Published in: Engineering, Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,539
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
135
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Finite state machines

  1. 1. FINITE STATE MACHINES (MEALY AND MOORE MACHINES) Gookyi Dennis A. N. SoC Design Lab. April 30, 2014
  2. 2. Contents: • Introduction • Moore machines • Mealy machines • Comparison 2
  3. 3. Introduction: • FSM’s can exist in several states and it goes from one state to another state based on the present state and the input conditions • Any synchronous circuit is an FSM of some form • This means that:  Combinational logic is an FSM without memory  Flip-Flops and counters are also FSM’s 3
  4. 4. General FSM 4
  5. 5. General FSM • The circuit diagram consists of: Combinational block: with primary input w and primary output z. it also consist of secondary inputs (present state) and secondary outputs (next state) Memory block: consist mainly of Flip-Flops. 5
  6. 6. Outputs of state machines: • No provision has been made to show the output z which is different from the state variables. The output can therefore be modelled in two distinct ways Moore machines Mealy machines 6
  7. 7. Moore machines: •Edward Moore’s model: D = F(W,Q) Z = G(Q) F and G are Boolean functions Output only depends on the current state (Q) Input (W) and current state (Q) determine the next state (D) 7
  8. 8. Moore state graph: 8
  9. 9. Moore state table Present state Input Next state output A B W Z 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 0 0 0 1 1 0 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 1 0 x x 0 1 1 1 x x 0 9
  10. 10. Moore maps 10
  11. 11. Moore circuit diagram: 11
  12. 12. Mealy machines • George Mealy’s model  D = F(W,Q)  Z = G(W,Q)  F and G are Boolean functions  Output depends on both current state (Q) and input (W)  Next state (D) depends on input (W) and current state (Q)12
  13. 13. Mealy state graph 13
  14. 14. Mealy state table Present state Input Next state output A B W Z 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 x x 0 1 1 1 x x 0 14
  15. 15. Mealy maps 15
  16. 16. Mealy circuit diagram 16
  17. 17. Comparison: Moore vs Mealy • Moore machines are safer to use Output change at clock edge In mealy machines, input change can cause output to change as soon as logic is done. • Mealy machines are faster because the output is dependent on the inputs. 17
  18. 18. Choosing between Moore and Mealy machines • It actually comes down to the task at hand when choosing between Mealy and More machines • These are a few questions to ask when choosing between either of the two:  Does one want to have a synchronous or asynchronous machine?  Is speed paramount?  Are both the inputs and present state readily available? • The answer to each of these questions determines the type of machine that would work best. 18

×