1 / 26

Lecture # 16

Lecture # 16. 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.

sorley
Télécharger la présentation

Lecture # 16

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 # 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 equivalentif 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 • The incoming transitions have the same output character. • 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 qi then qi will be converted to qi1 and qi2i.e. if at qi there are the transitions with two output characters then qi1 for one character and qi2 for other character.

  12. Proof cont… • Shift the output characters of the transitions to the corresponding new states qi1 and qi2 . Moreover, these new states qi1 and qi2 should behave like qi 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 q3into q13and q23

  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 L1 + L2 , L1L2 and L1* are also regular languages. • This fact can be proved by the following two methods

  21. (1) By Regular Expressions As discussed earlier that if r1, r2 are regular expressions, corresponding to the languages L1 and L2 then the languages L1 + L2 , L1L2 and L1* generated by r1+ r2, r1r2 and r1*, are also regular languages. (2) By TGs If L1 and L2 are regular languages then L1 and L2 can also be expressed by some REs as well and hence using Kleene’s theorem, L1 and L2 can also be expressed by some TGs. • Following are the methods showing that there exist TGs corresponding to L1 + L2 , L1L2 and L1*

  22. If L1 and L2 are expressed by TG1 and TG2 then following may be a TG accepting L1 + L2

  23. If L1 and L2 are expressed by following TG1 and TG2 then following may be a TG accepting L1L2 also a TG accepting L1* may be as under

  24. Example • Consider the following TGs

  25. Example cont… • Following may be a TG accepting L1+L2

  26. also a TG accepting L1L2 may be and a TG accepting L2*

More Related