Machine Problem 4, due Apr. 1

Part of the homework for CS:2820, Spring 2019
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Starting Point: Start with the posted solution to MP3. Add to it the code for class Simulation distributed with the lecture notes for March 8. Put the code for Simulation right after class ScanSupport and before class Gate.

Aside from the header comment on the entire file, which must have your name and section, you shoul make no changes to classes Errors ScanSupport or Simulation. Within the code for gates and wires, most of your changes will involve adding new simulation methods and perhaps changes that are consequences of these.

As usual, add a JavaScript @author tag to each class you modify giving your name and update the @version tag to give the date of your modification.

Specific New Requirements: Make the logic simulator actually simulate the digital logic, with the following behaviors:

Consider the following example circuit:

gate a input 1 1.0 2
gate b output
wire a 0.1 b

Here is an appropriate simulation output:

time 0.1 0->1 wire a 0.1 b
time 1.0 1->0 gate a input 1 1.0 2
time 1.1 1->0 wire a 0.1 b
time 2.0 0->1 gate a input 1 1.0 2
time 2.1 0->1 wire a 0.1 b

This trace is a debugging trace, totally inappropriate for simulations of any complexity, but very useful in seeing what is going on in very small models.

We do not recommend trying logic circuits with more than one or two real gates using this output format.