When we set an input at time t+ (tick), as we do at 0+ and 2+,
this corresponds to changing the value between the clock events.
The output shows the changed value of the input and any changes in
combinational logic caused by the input change. (Marked with () in the
output.) Since the DFF was not clocked by tick, its output does not
When we set an input at time t (tock), as we do at 5 and 7,
this corresponds to changing the value immediately after the
clock event causes the synchronous logic to update and the combinational
logic to propagate. The output is shown after the combinational logic
has propagated again after the input change.
XorDff Timing Diagram
Note that the down-arrow indicates the clock event.
XorDff Timing Diagram Detail at beginning of time 7
a) Clock event occurs.
b) Sequential logic updates.
c) Combinational logic propagates — the pulse is one of those
evil "glitches" from which synchronous design saves us.
d) Inputs change.
e) Combinational logic propagates.
f) Simulator output.
output-list time%S0.4.0 in%D0.6.0 addr%D0.6.0 load%B2.1.2 ARegister%D3.6.2 Areg%D1.6.1
PC%D1.6.1 pc%D1.6.1 RAM16K%D2.6.1 ram%D1.6.1 Screen%D2.6.1 scr%D1.6.1;
tick, output; tock, output;
// tick-tock write
set addr 1, set in 1111, set load 1,
set load 0,
There's more in the script that tests other aspects of the built-in parts.
(This is esoterica that would only be important if these simulated parts were real hardware...)
An unexpected thing that I found is that the DFFs in the built-in parts are implemented as
master-slave flip-flops instead of edge-triggered flip-flops. The test interface is
showing the value of the master FF and the out pin is showing the value of the
slave FF. (I expected that the built-in parts were displaying the asynchronous inputs to
|time| in | addr |load |ARegister| Areg | PC | pc |RAM16K| ram |Screen| scr |
|6 | 0| 1| 0 | 3333 | 3333 | 3333 | 3333 | 3333 | 3333 | 3333 | 3333 |
Inputs changed but no TICK -- test interface does not change. I/F is not async.
|6 | 2222| 1| 1 | 3333 | 3333 | 3333 | 3333 | 3333 | 3333 | 3333 | 3333 |
TICK -- interface changes. Master FF loaded from 'in'. 'out' does not change.
|6+ | 1111| 1| 1 | 1111 | 3333 | 1111 | 3333 | 1111 | 3333 | 1111 | 3333 |
Inputs changed but no TOCK -- test interface does not change.
|6+ | 0| 1| 1 | 1111 | 3333 | 1111 | 3333 | 1111 | 3333 | 1111 | 3333 |
TOCK -- interface does not change. Slave FF loaded from Master. 'out' changes.
|7 | 0| 1| 1 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 | 1111 |