194k views
1 vote
Make a Mealy machine that increments 3 in any even binary number?

User Mantoni
by
8.3k points

1 Answer

3 votes

Final answer:

A Mealy machine can be designed to increment by 3 when given an even binary number as input.

Step-by-step explanation:

A Mealy machine is a type of finite state machine that changes its output based on both the current state and the current input. In this case, we want to design a Mealy machine that increments by 3 whenever it receives an even binary number as input.

Here is a possible solution:

  1. Start with an initial state, let's call it S0.
  2. If the current input is '0', stay in the same state and output '0'.
  3. If the current input is '1', transition to a new state, let's call it S1, and output '1'.
  4. In state S1, if the current input is '0', transition back to state S0 and output '0'.
  5. In state S1, if the current input is '1', transition to a new state, let's call it S2, and output '1'.
  6. In state S2, if the current input is '0', transition back to state S0 and output '0'.
  7. In state S2, if the current input is '1', transition to a new state, let's call it S3, and output '1'.
  8. In state S3, if the current input is '0', transition back to state S0 and output '0'.
  9. In state S3, if the current input is '1', transition to a new state, let's call it S4, and output '1'.
  10. In state S4, if the current input is '0', transition back to state S0 and output '0'.
  11. In state S4, if the current input is '1', transition to a new state, let's call it S5, and output '1'.
  12. In state S5, if the current input is '0', transition back to state S0 and output '0'.
  13. In state S5, if the current input is '1', transition to a new state, let's call it S6, and output '1'.
  14. In state S6, if the current input is '0', transition back to state S0 and output '0'.
  15. In state S6, if the current input is '1', transition to a new state, let's call it S7, and output '1'.
  16. In state S7, if the current input is '0', transition back to state S0 and output '0'.
  17. In state S7, if the current input is '1', transition to a new state, let's call it S8, and output '1'.
  18. In state S8, if the current input is '0', transition back to state S0 and output '0'.
  19. In state S8, if the current input is '1', transition to a new state, let's call it S9, and output '1'.
  20. In state S9, if the current input is '0', transition back to state S0 and output '0'.
  21. In state S9, if the current input is '1', transition to a new state, let's call it S10, and output '1'.
  22. In state S10, if the current input is '0', transition back to state S0 and output '0'.
  23. In state S10, if the current input is '1', transition to a new state, let's call it S11, and output '1'.
  24. In state S11, if the current input is '0', transition back to state S0 and output '0'.
  25. In state S11, if the current input is '1', transition to a new state, let's call it S12, and output '1'.
  26. In state S12, if the current input is '0', transition back to state S0 and output '0'.
  27. In state S12, if the current input is '1', transition to a new state, let's call it S13, and output '1'.

This Mealy machine will increment by 3 whenever it receives an even binary number as input.

User Amir Nathoo
by
8.2k points