Administrator
|
The underlying reason that there is no clock on the DFF is that this simulator can't simulate it directly, and so it has to be inferred.
If you were to build, say, and RS latch using two NAND gates, the simulator would go bonkers because it has no concept of propagation delays through the gates -- it effectively assumes zero propagation time. So on every (inferred) clock cycle it lets the logic propagate through the gates until it stops changing. But if some of the gates have outputs that feedback into earlier gates in that path, it may never stop changing (or might stop after an unpredictable number of cycles). In a real circuit, the propagation delays result in the circuit latching in a stable result following a clock edge. But simulating that behavior requires a much more detailed simulation model for the gates and a much more sophisticated simulator and it opens some cans of worms as far as ways that students could go off the rails and do so in a course often taught by instructors that don't have a lot of experience dealing with these real world issues. So the authors simply left it out and impose a constraint on the logic you implement which forbids combinatorial logic from feeding back into itself (without being registered via a DFF that their simple simulator can use to break the feedback path so that the system can't oscillate).
|