1 / 7

Lecture 22:

Lecture 22:. Finite State Machines with Output. Moore Machine. Moore Machine - A Moore machine is a 6-tuple (Q, S , W , d , q 0 , F ) where, (1) Q is a finite set of states . (2) S is a finite set of symbols called the input alphabet .

ayanna
Download Presentation

Lecture 22:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 22: Finite State Machines with Output

  2. Moore Machine • Moore Machine - A Moore machine is a 6-tuple (Q, S, W, d, q0, F) where, • (1) Q is a finite set of states. • (2) S is a finite set of symbols called the inputalphabet. • (3) W is a finite set of symbols called the output alphabet. • (4) d: Q x S-> Q is the transition function • (5) q0 is an element of Q called the start state, and • (6) F: Q ->W is the output function mapping the current state to the output.

  3. Example Moore Machine • Each of the six elements of this example Moore machine are given below, • Q = {1, 2, 3} d = ([1,X]->2, [1,Y]->3, [1,Z]->1, • [2,X] ->3, [2,Y]->1, [2,Z]->2, • [3,X]->1, [3,Y]->3, [3,Z]->3) • S = { X, Y, Z} q0 = 1 • W = {A, B} F = (1->A, 2->B, 3->A)

  4. Mealy Machine • Mealy Machine - A Mealy machine is a 6-tuple (Q, S, W, d, q0, T) where, • (1) Q is a finite set of states. • (2) S is a finite set of symbols called the inputalphabet. • (3) W is a finite set of symbols called the output alphabet. • (4) d: Q x S-> Q is the transition function • (5) q0 is an element of Q called the start state, and • (6) T: Q x S->W is the output function mapping the current transition to the output.

  5. Moore Machine Substring Recognizer • Now let's look at how we build an FSM to find all occurrences of a particular substring in an input binary string. The first issue we need to resolve is whether we wish to allow overlap in the substrings. We can use the substring 1101 to illustrate substring overlap. Permitting overlap means that one or more bits can be part of more than one instance of a substring. • Consider the input string, • 1101101101101101101 • If we permit overlap, we find that the string contains six instances of the substring 1101. However, if we do not permit overlap, this string contains only three instances of the substring.

  6. Moore Machine: Recognizer for '1101' with Overlap

  7. Mealy Machine: Recognizer for "1101" with Overlap As a final example of bit string recognizers, we will build a Mealy machine to find the substring 1101 with overlap. Recall that a Mealy machine generates its output on the transition rather than upon entering a state. This may seem like a trivial difference, but it can sometimes permit us to reduce the number of states required. Upon reading the final bit in the substring sequence, this machine outputs a 1, otherwise it outputs a 0 each time it reads an input bit. This Mealy machine has one less state than the Moore machine designed to solve the same problem. Mealy machines will always require the same or fewer states to solve the same problem as Moore machines.

More Related