Re: coding the DFF
Posted by Noam on Dec 19, 2009; 7:48am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/coding-the-DFF-tp93847p94831.html
The answer is "no" and "no".
It was a pedagogic decision to treat a DFF as atomic rather than build it from NAND gates as is commonly done. The reasoning is that allowing loops in combinatorial logic gates requires deviating from their simple logical abstraction, complicating matters conceptually; similarly the temporal implications that this would allow would considerably complicate the simple abstraction of discrete time in sequential chips.
The simulator follows this decision and does not allow loops in combinatorial circuits (another "compilation-like" benefit of this decision). The whole internal logic of the simulator uses this restriction in an essential way, and is different (and more efficient) than usual hardware simulators that allow combinatorial loops. Similarly time is handled as a primitive by the simulator and there is no "clock" pin accessible from HDL.