Login  Register

Re: coding the DFF

Posted by milythael on Oct 13, 2011; 2:45am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/coding-the-DFF-tp93847p3417566.html

Implementing DFF with Nand gates requires a feedback loop, meaning the output of a gate affects the input of that same gate.  This kind of interaction works automatically in reality but it is a challenge to implement in code.  By limiting DFFs to a primitive it is possible to greatly simplify the implementation of the hardware simulator.  Additionally, disallowing feedback loops in combinatorial circuits (Chapters 1 & 2) gives a side benefit of identifying a class of errors students make in their designs more readily.  It also greatly supports the key point of the text that computers are layers of abstraction built upon each other.