Live data from Hacker News

From Nand to Tetris: Building a Modern Computer from First Principles

nand2tetris.org

21–30 of 49 posts

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#21
post #11
post #9

Earlier quoted context omitted.

It's an optimization. You really could build the whole thing from NAND gates if you really wanted to. http://www.learningaboutelectronics.com/Articles/D-flip-flop...

Thanks, that page is nice, but it too emphasizes that you also need a clock. That's essential and it was the point I was trying to make. For example, a thing that is usually glossed over in OS courses (in favor of, let's say, scheduling algorithms and such) is that you simply can't make preemptive multitasking out of pure code - and later when you ask yourself how is it that such a phenomenon is possible in the first…

Couldn't you in theory build a clock purely from nand gates? You create a cycle of nand gates where the output of one is tied to both inputs of the next. If the cycle have an uneven number of nand gates, each nand will oscillate with a period depending on the length of the cycle.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#22
post #8

The title of the course is misleading, as it suggests that NAND gates are the only required primitive, whereas the course later introduces DFF gates, without which you cannot escape the parallelism of chips.

I created a basic CPU with just resistors. Super slow, manual step only, but it worked and had some basic instructions.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#24
post #8

The title of the course is misleading, as it suggests that NAND gates are the only required primitive, whereas the course later introduces DFF gates, without which you cannot escape the parallelism of chips.

And one thing that is said even less is why NAND? You can do it all with NOR gates as well if you want. The reason for NAND has to do with the switching speed, pMOS switches quicker in parallel (either transistor can get the current flowing) and nMOS switches quicker in series (either transistor can stop the current flowing); this is how a NAND gate is wired. NOR gates on the other hand have the worst of both. The fa…

During my intro to computer engineering course, lectures touched on why NAND gates, and the conclusion was that you can build anything you need in a basic computer using NAND gates. It boils down to expense. A BOM (bill of materials) with fewer line items tends to be cheaper.

This doesn't really hold in today's world of silicon prints, but at the start I think it was price that drove the decision.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#25
post #10

I made a small game inspired by the first lessons in the course: http://nandgame.com/

Have spent some time playing it - something that would be interesting is a view switch which expands your design again into NAND gates such that you can really appreciate the complexity of what's going on.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#26
post #10

I made a small game inspired by the first lessons in the course: http://nandgame.com/

My most striking instance yet of the Baader-Meinhof phenomenon: yesterday, I ran into a colleague I hadn't seen in months, and he recommended I check out this incredibly cool website where you build a basic computer starting with logic gates called nandgame.com. Just now, I was about to check it out, but thought I'd skim Hacker News first... To stumble upon this post, and a comment from the nandgame creator himself. Thank you in advance for building such an awesome educational resource!

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#27
post #22
post #8

The title of the course is misleading, as it suggests that NAND gates are the only required primitive, whereas the course later introduces DFF gates, without which you cannot escape the parallelism of chips.

I created a basic CPU with just resistors. Super slow, manual step only, but it worked and had some basic instructions.

Interesting.

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#28
post #25
post #10

I made a small game inspired by the first lessons in the course: http://nandgame.com/

Have spent some time playing it - something that would be interesting is a view switch which expands your design again into NAND gates such that you can really appreciate the complexity of what's going on.

That would be really cool!

Re: From Nand to Tetris: Building a Modern Computer from First Principles

#29
post #4

I just completed part 1 building a computer from gates and writing an assembler and am in the middle of part 2 where you develop compilers and a stack based virtual machine. For someone like me who did not study computer science but has been a self taught programmer in the Analytics spacefor over a decade, this has been a tremendously useful and accessible introduction to basic CS concepts and very eye opening in ter…

> I wonder if there are similar courses on CS algorithms for people who didn't study CS in college.

This might be a bit more challenging and less hand holding than the nand2tetris course but if you are up for it, why not go with the best? Sedgewick Algorithm book has been one of the standard algorithm books in universities for a long time.

https://algs4.cs.princeton.edu/home/

https://www.coursera.org/learn/algorithms-part1

https://www.coursera.org/learn/algorithms-part2

Post reply on HN