The Elements of Computing Systems (Nand2Tetris)

This thread is for people who are interested in working through the book, The Elements of Computing Systems: Building a Modern Computer from First Principles, or the associated Nand2Tetris course.

Chapter Discussions:

  • Chapter 1
  • add more chapters here (anyone can edit this top wiki-post)

If anyone wants to work through the Coursera course, the next session begins Jan 1, 2018.

I’ve previously worked through the first 6 chapters of nand2tetris, through writing an assembler and corresponding with part 1 of the course on Coursera.
My plan is to review Chapter 1-6, and then move on to the second half, hopefully at a rate of a chapter every ~2 weeks.
I’m also going to try and integrate this with my ongoing effort to learn emacs. This major mode looks promising.

1 Like

That sounds like a good pace. I will try to read the book, though I don’t think I’ll time to watch the videos right now.

My book arrived. Haven’t had time to start it yet though.

1 Like

I took a look at that, but the installation instructions aren’t very clear, and it doesn’t seem to be available in the package manager. :thinking:

The Coursera course starts again on January 1st. I signed up, though I don’t know if I will be able to keep up with that pace. I read Chapter 1 of the textbook, and it’s pretty interesting so far.

Edit: I found this plugin for Vim:

I’ve finally posted my hdl files for Chapter 3 to Github:

I’ll try to post diagrams for those solutions soon (after I decipher the diagrams I scratched out for myself over the last week or so – hmm, they made sense at the time at least).

One thing of note: This is my second attempt at working through this book, and my solution for PC.hdl came out much nicer this time around. Last time I made the nested if-else part way too complicated. So, if anyone else is struggling with some of these exercises, it may be that coming back to them a little later on will shed new light on things.

1 Like

A book that is often mentioned along with The Elements of Computing Systems is Code by Charles Petzold. I read it a couple years ago and enjoyed it quite a lot. There’s definitely some overlap between the two books, but they’re still quite different. For example, Code is more something to read through rather than work through. I still have a hard copy if anyone wants to take a look at it or borrow it. (The pdf is also pretty easy to find.)

That one is also near the top of my reading list.

I finally set up my “math table”* tonight so I’m going to focus on that for now. (plus slowly working through the nand2tetris book and Algorithms 4th ed.)

(*The table is just for math, since I’m behind on my goals in that area and want to make sure my books don’t get buried by other things. I have another table next to it for my computer and other study topics.)

Very key things here for me:

  • “… I’m going to focus on that for now.”
  • “… want to make sure my books don’t get buried by other things.”

A big resolution for me this year is to focus on the things I’m reading/working on until they’re finished. In the past I’ve been way too easily distracted, and starting new books/projects has always been more fun than finishing current ones.

1 Like

I’ve posted my Chapter 4 solutions.
Now on to Chapter 5 (where I quit the last time I tried to work through this book :slight_smile: ).

1 Like

I’ve posted my Chapter 5 solutions, notes, and diagrams.
The CPU chip took me a long time to figure out, which made it all the more satisfying to finish. :slight_smile:

I’ve just started reading Chapter 6 which covers the writing of an assembler.

1 Like

Me in Chapter 4: Wow, programming in this mini assembly language is so cool! :sunglasses:

Me in Chapter 7: Just one address register and one data register?! Writing the simplest assembly program is like attempting a Houdini escape! :cold_sweat:

1 Like

Slowly, slowly I’m clawing my way through this book. Finally finished Chapter 7. I’m posting all my solutions and notes here:

1 Like

How’s it going on this? Do you recommend the coursera course to work through this or just a book?

Ugh, I have completely stalled on this recently and better get back to it soon before I forget too much. I left off in the middle of Chapter 8.

I’ve only been working through the book, so I can’t compare that to doing the Coursera course. The latter might be worth a try, as I’ve found parts of the book fairly challenging, especially the recent parts. In Chapters 7 and 8 you use the language of your choice (Python for me) to write a translator to translate programs written in their virtual machine language into programs written in their assembly language. As you can guess, there’s a lot that can go wrong here, and the most common error message I get is “Test Comparison Failed.” :expressionless: I really need to soldier on though. If I can just finish up Chapter 8 I can at least be done with the assembly language stuff.

Haha, what a lot of whining I’m doing! I should add that I still think this book/course is worth working through. I’ve been learning a ton about things I’ve wanted to know about for many years.

1 Like

Did you ever power through in the end?
I think after learning Vue, this may be next for me.

(sigh) Nope, I still haven’t progressed any further. However, it’s interesting that you’re asking this now, because just in the last week or so I decided to take another stab at this book. So, I’ve been spending the last few days reviewing the chapters on assembly language and the virtual machine since I left off right in the middle of that stuff and have since forgotten the details. Looking back at this thread though I’m reminded that there are also lecture videos. So, I may watch some of those as well.

When/if you try this book/course, let me know. I’ve had rather a hard time working through it on my own, but having someone to compare notes with would probably help a lot. Even going back over the chapters I’ve already completed with someone else would be a good review for me.

There’s a copy available in the book lending library. If you want to take a look, let me know and I’ll bring it to a meetup.

Lo! This project yet lives!
I have FINALLY completed the Chapter 8 project, and sweet mother of Grace Hopper I’ve written my last line of assembly code. Now it’s on to writing everything in their stack-based virtual machine language. Oooh, fancy! :slight_smile:

1 Like

I’m not sure if this was mentioned in the forum yet, but this was posted in chat.

1 Like