1 / 2

Division Mod 7 FSM

0. 6. 1. 2. 5. 3. 4. Division Mod 7 FSM.

ita
Download Presentation

Division Mod 7 FSM

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. 0 6 1 2 5 3 4 Division Mod 7 FSM Input is a number (decimal sequence of numerals). Ends up at the state whose name indicates the remainder when the input number is divided by 7. The key intuition is that if a number x has remainder of r when divided by 7, then the remainder of the number obtained by appending numeral n at the end of x must have remainder of 10r + n mod 7. For example, 66 has remainder 3 when divided by 7, so 668 should have remainder 30 + 8 mod 7, or 38 mod 7, or simply 3. (And indeed, 668 = 7 x 95 + 3.) This observation is true because if x mod 7 = r, then x = 7q + r for some quotient q. Then the number obtained by appending the numeral n to the end of x results in multiplying x by 10, and then adding n, is 10x + n = 10(7q+r) + n = 70q + 10r + n, which has remainder of 10r+n mod 7, since the first term is divisible by 7. This observation dictates that from state r (indicating that current remainder is r), the next state on input n should be to state 10r+n mod 7. (The remainder when 10r + n) is divided by 7. These transitions are drawn above.

  2. Division Mod 7 FSM 0 0 1 6 4 5 5 2 3 6 1 4 2 3 1 6 2 5 3 4

More Related