Download presentation
Presentation is loading. Please wait.
Published byJoanna Chambers Modified over 8 years ago
1
Lecture # 16
2
Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are very much helpful in computing. The incrementing machine helps in building a machine that can perform the addition of binary numbers. Using the complementing machine along with incrementing machine, one can build a machine that can perform the subtraction of binary numbers.
3
Equivalent machines Two machines are said to be equivalent if they print the same output string when the same input string is run on them. Two Moore machines may be equivalent. Similarly two Mealy machines may also be equivalent, but A Moore machine can’t be equivalent to any Mealy machine. However, ignoring the extra character printed by the Moore machine, there exists a Mealy machine which is equivalent to the Moore machine.
4
Theorem Statement: For every Moore machine there is a Mealy machine that is equivalent to it (ignoring the extra character printed by the Moore machine). Proof: Let M be a Moore machine, then shifting the output characters corresponding to each state to the labels of corresponding incoming transitions, machine thus obtained will be a Mealy machine equivalent to M.
5
Note It may be noted that while converting a Moore machine into an equivalent Mealy machine, the output character of a state will be ignored if there is no incoming transition at that state. A loop at a state is also supposed to be an incoming transition. Following is the example of converting a Moore machine into an equivalent Mealy machine
6
Example Consider the following Moore machine Using the method described earlier, the above machine may be equivalent to the following Mealy machine
7
Example Cont… Running the string abbabbba on both the machines, the output string can be determined by the following table
8
Example Cont…
9
Theorem Statement: For every Mealy machine there is a Moore machine that is equivalent to it (ignoring the extra character printed by the Moore machine).
10
Proof Let M be a Mealy machine. At each state there are two possibilities for incoming transitions 1. 1. The incoming transitions have the same output character. 2. 2. The incoming transitions have different output characters. If all the transitions have same output characters, then shift that character to the corresponding state.
11
Proof cont… If all the transitions have different output characters, then the state will be converted to as many states as the number of different output characters for these transitions, which shows that if this happens at state q i then q i will be converted to q i 1 and q i 2 i.e. if at q i there are the transitions with two output characters then q i 1 for one character and q i 2 for other character.
12
Proof cont… Shift the output characters of the transitions to the corresponding new states q i 1 and q i 2. Moreover, these new states q i 1 and q i 2 should behave like q i as well. Continuing the process, the machine thus obtained, will be a Moore machine equivalent to Mealy machine M. Following is a note
13
Note It may be noted that if there is no incoming transition at certain state then any of the output characters may be associated with that state. It may also be noted that if the initial state is converted into more than one new states then only one of these new states will be considered to be the initial state. Following is an example
14
Example Consider the following Mealy machine
15
Example cont… Shifting the output character 1 of transition b to q0
16
Example cont… Shifting the output character 0 of transition a to q1
17
Example cont… Shifting the output character 1 of transition b to q2
18
Example cont… Splitting q 3 into q 1 3 and q 2 3
19
Example cont… Running the string abbabbba on both the machines, the output strings can be determined by the following table
20
Regular languages As already been discussed earlier that any language that can be expressed by a RE is said to be regular language, so if L1 and L2 are regular languages then L 1 + L 2, L 1 L 2 and L 1 * are also regular languages. This fact can be proved by the following two methods
21
(1) By Regular Expressions As discussed earlier that if r 1, r 2 are regular expressions, corresponding to the languages L 1 and L 2 then the languages L 1 + L 2, L 1 L 2 and L 1 * generated by r 1 + r 2, r 1 r 2 and r 1 *, are also regular languages. (2) By TGs If L 1 and L 2 are regular languages then L1 and L2 can also be expressed by some REs as well and hence using Kleene’s theorem, L 1 and L 2 can also be expressed by some TGs. Following are the methods showing that there exist TGs corresponding to L 1 + L 2, L 1 L 2 and L 1 *
22
If L 1 and L 2 are expressed by TG 1 and TG 2 then following may be a TG accepting L 1 + L 2
23
If L 1 and L 2 are expressed by following TG 1 and TG 2 then following may be a TG accepting L 1 L 2 also a TG accepting L 1 * may be as under
24
Example Consider the following TGs
25
Example cont… Following may be a TG accepting L 1 + L 2
26
also a TG accepting L 1 L 2 may be and a TG accepting L 2 *
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.