17. Discussing MP4

Part of CS:2820 Object Oriented Software Development Notes, Fall 2017
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

 

The following test files for MP4 were discussed

-- a chain of inverters fed from a true constant
gate A const 1.0
gate B not 1.0
gate C not 1.0
gate D not 1.0
wire A true B in 1.0
wire B out C in 1.0
wire C out D in 1.0

If there are n inverters, the above produces a chain of approximately n/2 pulses on the output of the final inverter before it settles down into its final state.

-- an inverter in a feedback loop
gate A not 1.0
wire A out A in 1.0

The total time delay around the above loop is 2 time units. The result is an oscillator with a period of 4. This oscillator runs forever, so the simulation never settles down into a final state.

-- a feedback loop with a time limit
gate A const 20
gate B or 1
gate C not 1
wire A true B in1 1
wire B out C in 1
wire C out B in2 1

The above circuit contains a loop between gates B and C. The time delay on this loop is 4 time units, so the period of the oscillator is 8 time units. The oscillator only oscillates when the true output of gate A is false, so when gate A finally reaches its final state, after 20 time units, it stops the oscillator.