Machine Problem 4, due Oct. 30
Part of
the homework for CS:2820, Fall 2017
|
Write a Java program, in file Logic.java that meets all of the requirements for MP3, except that, if there are no errors in the input file, it runs a simulation of the behavior of the input as follows:
If there are no errors in the input, the output of your program should be a sequence of reports of gate output changes, one line per report. For example, if at time 0.7, the output out of gate A changes to true you should report:
0.7: A out true
Note that some input circuits will generate infinite outputs, while others will eventually reach a stable state after which nothing occurs, allowing the simulation to terminate.
Grading criteria: No credit will be given to programs that do not represent a substantial attempt at meeting the requirements of this assignment. Your program must:
Note that MP4 will involve extending MP3 to simulate the behavior of gates, so planning for this, while not part of this assignment, may simplify the next.
Note that the requirements for header comments in the file header are absolute. Your name must appear in the form that it appears on your ID card. The TAs will not waste their time doing detective work to attempt to figure out who submitted what code.
Submission: Your solution should consist of a single file named Logic.java, with a public method, main. (We will chop the file into smaller more managable pieces later, as it grows.)
To submit your solution, use the submit Logic.java shell command while your current directory is the one holding the source file. The dialogue with the submit command will be similar to that you used with MP1 and MP2, except that you will use mp3 in the dialogue.