Re: Why we need the DFF to build the Register
Posted by ivant on Mar 26, 2020; 7:40am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Why-we-need-the-DFF-to-build-the-Register-tp4034340p4034341.html
This is true in general, but not for the hardware simulator developed for the N2T course. It is simplified and cannot handle cycles (unless they are "broken" by the provided DFF).
You can create a flip-flop without clock. But what would it mean to create a register without a clock? It is supposed to emit the value from the previous input, that is out[t] = in[t - 1]. How would you know when to get these values without a clock? It is in the specification in the form of t.
In the real world (not simulators) it takes time for something to happen. Changing the signal from 0 to 1 for example isn't instantaneous. It will move through values, which are digitally not valid, it may fluctuate several times before it stabilizes to a value, which we interpret as a digital 1. Each gate needs some time for its inputs to stay stable before it can produce a correct and stable output. This output is often an input to another gate, which also needs its inputs stable, and so on. You can calculate these times for circuits as well, by finding the slowest path for the signals to propagate from the inputs to the outputs.
In a purely combinational circuit you can just wait for the outputs to stabilize and call it a day. But once you introduce state things become harder. Suppose one of these circuits is a 1-bit memory of some sort. You want it to remember the value in its input when it's the correct one. Too early or too late and it might not even be a valid value. The clock is used to synchronize these and to "instruct" the register to remember the value when it's valid. The propagation times of the circuits dictate the minimum and maximum allowed clock speeds.
P.S. I'm a software guy and my knowledge about electronics is very rudimentary. I'm sure there are much more considerations when you develop real hardware.
P.P.S. To include an image, just click on "Insert Image" button in the edit form.