I do not understand the math notation in this chapter.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

I do not understand the math notation in this chapter.

burge91
Out(t) = In(t-1)

These makes no sense to me. So t fluctuates between 0 and 1 according to the clock, or does the whole bracketed statement do that? Can t be 500? Is Out being multiplied by t or is it operating on t? The way I understand this is “Out is now what In was before” but this leaves me asking 10 billion other questions.

I have built the first chip (the Bit) using the software, but I did that by constantly trying different things rather than reaching an understanding, so I’m not continuing until I have some clarity as this isn’t a recipe for understanding anything.

I have tried YouTube vids explaining memory circuits but haven’t found anything good.
Reply | Threaded
Open this post in threaded view
|

Re: I do not understand the math notation in this chapter.

cadet1620
Administrator
Chapters 1 and 2 are all combinational circuits. The circuits are dealt with like math equations—evaluate them step by step until you get the answer—and there is always the same result for a particular combination of inputs. The abstract view is that time is not involved. (The real world gets messy because it does take time for a gate to change its output after its input(s) change.)

Chapter 3 introduces the idea of time, which is represented by the variable t. In this abstract view, time is an integer that starts at 0 and increases by steps of 1.

A more mathish way to write Out(t) = In(t-1) would be
  Outt = Int-1
which makes it more evident that t is a subscript to variables Out and In.

Another way to think of it is as a program where Out and In are arrays and t is an array index.

bool In[infinity], Out[infinity]

t = In[0] = Out[0]
while (true) {
    t = t+1;
    Out[t] = In[t-1];
}
“Out is now what In was before” is a very good description, by the way.


Some students find it easier to think about "what happens next" rather than "what happened before." This changes the statement to
  Outt+1 = Int

--Mark

Reply | Threaded
Open this post in threaded view
|

Re: I do not understand the math notation in this chapter.

burge91
If we were dealing with billiard balls, then what would the mechanism be doing? Would it be holding one billiard ball and pushing the one previously held out? This kind of analogy would help me a lot. I am also going to try to make an animation of a flip flop from animated Nands so that I can confirm to myself that I fully understand it.

This book is great and I appreciate the authors of it and online help.
Reply | Threaded
Open this post in threaded view
|

Re: I do not understand the math notation in this chapter.

cadet1620
Administrator
Yes, your machine that holds a billiard ball for one clock period would be a good analogy for the DFF.

You mention animating Nands. If you are trying to understand what is going on inside the DFF, check out this site.
    http://www.play-hookey.com/digital/sequential/

It has live circuits that you can poke at and watch how they work. I suggest starting at the top with Nand Latch so that you will see how the parts go together to make the DFF.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: I do not understand the math notation in this chapter.

AverageOyster
Mark, I was playing around with the D flip-flop simulation on that website you posted and saw something which confused me. The D flip-flop on the website seems to behave differently from the DFF built-in chip included with the Nand2Tetris software package. The DFF on the website appears to output whatever value is seen at D during the falling clock edge, whereas the DFF built-in chip appears to "take in" whatever input value is seen at the rising clock edge and then output that "taken in" value at the falling clock edge regardless of the value of the input at the falling clock edge. From what I've read in a digital logic textbook I have, it seems like the DFF on the website more accurately reflects the true behavior of real DFFs.

Are you able to comment on this discrepancy at all? Why doesn't the odd behavior of the built-in DFF cause problems later on? If the way I described the discrepancy doesn't make sense then I can provide a concrete example of what I'm talking about.
Reply | Threaded
Open this post in threaded view
|

Re: I do not understand the math notation in this chapter.

burge91
In reply to this post by burge91
after much thought i have figured out the configuration :) it took the mental breakthrough of choosing sensible names for pins, and then everything just sort of "fell into place". Still slightly anxious about building on top of something I don't fully understand, but I guess I should forget that, because it didn't hold me back in the last few chapters.
Reply | Threaded
Open this post in threaded view
|

Re: I do not understand the math notation in this chapter.

cadet1620
Administrator
In reply to this post by AverageOyster
The HardwareSimulator's DFFs are master-slave like the example on play-hookey. See this forum post.

There is another type of DFF that is called edge-triggered, that behaves as you are describing—it ignores the input until the moment the clock falls. The implementation of edge-triggered flip-flops is a bit difficult to understand because they depend on analog properties of the transistors that implement them.

There are also flip-flops that are active on the positive edge.

--Mark