Here, is an example finite state machine that represents a solution to a problem for circuit design. (The problem is to keep track of whether the sum of the inputs is a multiple of 3. The inputs are unsigned 2-bit integers.) Implement this machine in Java.
- Define a class MultiplesOf3 which supports a function computeY(String input) that returns 1 if the Y output should be 1, 0 if the Y output should be 0.
- The input parameter can be one of “00”, “01”, “10” or “11” to represent the inputs for X