11 ms·
From Nand to Tetris: Building a Modern Computer from First Principles
- leowoo91 8y agoI wish that existed as a last year course in college. It has a lot of recap on the parts that creates a modern day computer and likely gives you understanding where imperative languages come from.
- sfifs 8y agoI believe several college CS courses globally use this in year 2 or year 3.
- JoeSmithson 8y agoI really cannot recommend this course enough, I find myself referring back to it in so many different fields (security, debugging, programming language design) When I finished school, I was fairly knowledgeable about physics, including logic gates and electronics, and I was a fairly good programmer, but I had no idea how that virtual world arose from the physical. When I type on a keyboard, what is physically happening in the universe? This course helped me understand that question.
- neuralzen 8y agoWell said, this pilgramage is definitely a worthwhile one.
- sfifs 8y agoI 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 terms of what's actually happening under the hood. This course is highly recommended if you've not studied CS though be aware the second part of the course where you develop compilers is quite intense though being an online course, you can pick your pace. I wonder if there are similar courses on CS algorithms for people who didn't study CS in college.
- barry-cotter 8y agohttps://www.edx.org/micromasters/ucsandiegox-algorithms-and-data-structures https://www.edx.org/micromasters/ucsandiegox-algorithms-and-... Comprises the following courses Algorithmic Design and Techniques Data Structures Fundamentals Graph Algorithms NP-Complete Problems String Processing and Pattern Matching Algorithms Dynamic Programming: Applications In Machine Learning and Genomics Graph Algorithms in Genome Sequencing Algorithms and Data Structures Capstone
- tankenmate 8y agoVery little of which is communicated in any way to help someone learn how compilers work. In the actual history of computing very few good compilers were ever written by algorithm and data structures professors; most were written by people who had a pragmatic drive to get something done. Theory is good but without practice it is little more than navel gazing. Theory and practice need each other. The reason that nand2tetris works so well as a course is that it gives you a concrete example of how all these algorithms and data structures are combined in order to turn an abstract description (the source code) into a running program that also includes how that computing is achieved through compiler, assembler, linker, run time, operating system, isa, and finally in transistors. The true issue it gets to is that most programmers have very little understanding of how computers actually work, and when things break they just do high order guessing to get things working again rather than truly understanding what went wrong.
- madengr 8y agoAs an EE undergrad, I had to design a TTL based processor, program the microcode, etc. I have no idea how a compiler works, or anything above assembly.
- thanosnose 8y ago> 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://algs4.cs.princeton.edu/home/ https://www.coursera.org/learn/algorithms-part1 https://www.coursera.org/learn/algorithms-part1 https://www.coursera.org/learn/algorithms-part2 https://www.coursera.org/learn/algorithms-part2
- Cyphase 8y agoPrevious discussions: https://news.ycombinator.com/item?id=13209452 https://news.ycombinator.com/item?id=13209452 https://news.ycombinator.com/item?id=14526344 https://news.ycombinator.com/item?id=14526344
- ASipos 8y agoThe 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.
- jacquesm 8y agoIt'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-circuit-with-NAND-gates.php http://www.learningaboutelectronics.com/Articles/D-flip-flop...
- ASipos 8y agoThanks, 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 place you learn that chips are inherently parallel, that sequential code is an abstraction over that so that one can have some sort of law and order, and only then interrupts enter the scene so that one may break that order when needed, e.g. for preemption.
- jacquesm 8y agoYou can make a clock easily enough: two NAND gates, two resistors, two capacitors. If you use parasitic components you will get a pretty wild resonance so better to nail it down by using something a bit more stable. But in principle it will work just fine. Agreed on the 'preemtive multitasking' bit, but that has little to do with this subject. And it is kind of embedded in the name, you need something to do the pre-empting which by definition has to come from outside. But building a functional computer with just NAND gates is absolutely possible, even if there are better ways, just like you could use Brainfuck or combinators to do meaningful computation. The whole idea of the course is not to give some kind of purist model for computation but to show that the essence of a computer can be boiled down to some very simple building blocks. So the title of the course is misleading only if you want to pick nits. Course titles are made to attract students and to give broad cover to what the course is all about, not to satisfy language purists.
- sergex 8y agoI made a small game inspired by the first lessons in the course: http://nandgame.com/ http://nandgame.com/
- asrp 8y agoI found your game to be a great improvement over the course's UI. Well done!
- lindenr 8y agoJust spent some time playing around with that, really cool! Thank you :)
- Gladdyu 8y agoHave 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.
- sergex 8y agoThat would be really cool!
- EForEndeavour 8y agoMy 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!
- MrMoenty 8y agoJust played through it and really liked it! I think this is just the right level of abstraction for a beginning CS student. Makes it easy to grasp the compositional nature of computers without having to deal with all the details that make circuit design hard, like the non-instantaneous response of real components.
- kyberias 8y agoThe font on that site looks absolutely horrible on Windows 10+Chrome.
- gmiller123456 8y agoThey mentioned at the end about actually implementing the CPU in hardware with an FPGA. Just curious if anyone has actually tried that?
- stefanpie 8y agoA quick google search yielded this: http://excamera.com/sphinx/fpga-cpu.html http://excamera.com/sphinx/fpga-cpu.html
- userbinator 8y agoIf you would like to start at a slightly lower level, Charles Petzold has written a great book on the subject: https://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319 https://www.amazon.com/Code-Language-Computer-Hardware-Softw...
- bigmit37 8y agoThank you. Going to see if I can get it from my local library.
- WalterGR 8y agoUsing everyday objects and familiar language systems such as Braille and Morse code, author Charles Petzold weaves an illuminating narrative for anyone who’s ever wondered about the secret inner life of computers and other smart machines. ... cleverly illustrated and eminently comprehensible story ... No matter what your level of technical savvy, CODE will charm you—and perhaps even awaken the technophile within. Code doesn’t sound “slightly lower level”.
- sergex 8y agoCode goes into how logic gates like the nand gate are built, so it does start at a lower level than Nand to Tetris which start with nand gates as primitives.
- mrunkel 8y agoI think you and the GP are using "lower level" in different ways. GP means with a lower barrier to entry, you mean "closer to the electrons" if I understand both of you correctly.
- jpochtar 8y agoOnce you’ve learned programming, this book is maybe the perfect survey course to understand systems. It gave me a framework for understanding all the layers from CPU to ReactJS that 4+ years of college never could so concisely