Question: 0 [001 1 0 8 0 COSC 2425 - Computer Organization Lab #3 - Moore Machine Create a Java program which implements this Moore machine.


0 [001 1 0 8 0 COSC 2425 - Computer Organization Lab #3 - Moore Machine Create a Java program which implements this Moore machine. Requirements 1. The program must be written in Java. D 2. It must request the initial state and the input. It displays [013 [10] the machine's output and the final state, as in the example below. (11) 3. The input is a string of zeros and ones only. 4. If the initial state or input is invalid, an error message is produced. The program may, but is not required to use Java exceptions in this case 5. The program must implement the entire Moore machine, not just the inputs below. The instructor will test it with different input Hint: There are many different ways to do this, but consider using an array of state objects. One way is to declare this class, 0 W this class represents one state in a Moore machine public class Moore private char state; The name of the state private String output; 17 The output displayed when this state is entered int zero; W The index of the next state given an input of 0 int one: The index of the next state given an input of 1 w Public constructors and methods here Then in main you can create the array of states like Moore () mooreStates - new Moore (5) mooreStates [0] = new Moore ! 0, 0); mooreStates (1) - new Moore('A'. "O", 2, 4); moorestates (2) - new Moore (B'"01", 2, 3) mooreStates [3] = new Moore "11 43) mooreStates [4] = new Moore ( "ID", 3, 1); Upload: Your Java (java) file. Sample Output Please enter the initial State: Please enter the input: The output : O Paul Koester, Dallas County Community College, 2018 Salari File Edit View History Bookmarks Window Help learn-east-1-prod-feet-wythos.content blackboard.com ab dem 1000 10 00 The final State ist A please enter the initial State: Please enter the input: 10010100 The output is: 00 10 11 10 00 01 11 10 11 The final State is c 30 OSTICI
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
