# The Elements of Computing Systems (Nand2Tetris)

**URL:** https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24
**Category:** Learning Resources and Study Groups
**Tags:** nand2tetris
**Created:** [December 16, 2017, 10:12pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24 "2017-12-16T22:12:27Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)
#### Post date: [December 16, 2017, 10:12pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/1 "2017-12-16T22:12:27Z")

</div>

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](http://nand2tetris.org/).

Chapter Discussions:

- [Chapter 1](https://forum.codeselfstudy.com/t/elements-of-computing-systems-nand2tetris-chapter-1/122)
- 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.

> **[Build a Modern Computer from First Principles: From Nand to Tetris...](https://www.coursera.org/learn/build-a-computer)**
>
> Learn how computers work by building one from the ground up in this hands-on course from the Hebrew University of Jerusalem. Explore logic gates, architecture, compilers, and more. Enroll for free.

---

<div class="post-metadata">

### Author: ![bdjewkes](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/bdjewkes/32/7_2.png) [@bdjewkes](https://forum.codeselfstudy.com/u/bdjewkes)
#### Post date: [December 16, 2017, 11:43pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/2 "2017-12-16T23:43:32Z")

</div>

I’ve previously worked through the first 6 chapters of nand2tetris, through writing an assembler and corresponding with [part 1](https://www.coursera.org/learn/build-a-computer#syllabus) 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](https://github.com/nverno/nand-hdl-mode) looks promising.

---

<div class="post-metadata">

### Author: ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)
#### Post date: [December 16, 2017, 11:44pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/3 "2017-12-16T23:44:49Z")

</div>

> [@bdjewkes](#):
>
> a chapter every ~2 weeks

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.

---

<div class="post-metadata">

### Author: ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)
#### Post date: [December 23, 2017, 8:32pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/4 "2017-12-23T20:32:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)
#### Post date: [December 24, 2017, 8:01am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/5 "2017-12-24T08:01:54Z")

</div>

> [@bdjewkes](#):
>
> This major mode looks promising.

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. 🤔

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.

> **[Build a Modern Computer from First Principles: From Nand to Tetris...](https://www.coursera.org/learn/build-a-computer)**
>
> Learn how computers work by building one from the ground up in this hands-on course from the Hebrew University of Jerusalem. Explore logic gates, architecture, compilers, and more. Enroll for free.

Edit: I found this plugin for Vim:

> **[GitHub - sevko/vim-nand2tetris-syntax: Vim syntax files for the ad-hoc languages in...](https://github.com/sevko/vim-nand2tetris-syntax)**
>
> Vim syntax files for the ad-hoc languages in Nand2Tetris (Elements of Computing Systems)

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [December 28, 2017, 3:31am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/6 "2017-12-28T03:31:22Z")

</div>

I’ve finally posted my hdl files for Chapter 3 to Github: [https://github.com/philomathdan/Nand2Tetris](https://github.com/philomathdan/Nand2Tetris)

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.

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [January 2, 2018, 1:24am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/7 "2018-01-02T01:24:08Z")

</div>

A book that is often mentioned along with _The Elements of Computing Systems_ is [_Code_ by Charles Petzold](https://www.goodreads.com/book/show/44882.Code). 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.)

---

<div class="post-metadata">

### Author: ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)
#### Post date: [January 2, 2018, 2:41am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/8 "2018-01-02T02:41:35Z")

</div>

> [@Dan](#):
>
> A book that is often mentioned along with The Elements of Computing Systems is Code by Charles Petzold.

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

I finally set up my “[math table](https://forum.codeselfstudy.com/t/daily-study-plans/119/3)”\* tonight so I’m going to focus on that for now. (plus slowly working through the nand2tetris book and [Algorithms 4th ed](https://forum.codeselfstudy.com/t/algorithms-4th-edition-sedgewick-wayne/25).)

(\*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.)

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [January 2, 2018, 3:42am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/9 "2018-01-02T03:42:24Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [January 10, 2018, 9:24pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/10 "2018-01-10T21:24:42Z")

</div>

I’ve posted my [Chapter 4 solutions](https://github.com/philomathdan/Nand2Tetris/tree/master/Chapter%204).  
Now on to Chapter 5 (where I quit the last time I tried to work through this book 🙂 ).

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [January 19, 2018, 4:20am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/11 "2018-01-19T04:20:31Z")

</div>

I’ve posted my [Chapter 5 solutions, notes, and diagrams](https://github.com/philomathdan/Nand2Tetris/tree/master/Chapter%205).  
The CPU chip took me a long time to figure out, which made it all the more satisfying to finish. 🙂

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

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [February 13, 2018, 7:16pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/12 "2018-02-13T19:16:00Z")

</div>

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

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

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [March 2, 2018, 7:53pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/14 "2018-03-02T19:53:04Z")

</div>

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

> **[philomathdan/Nand2Tetris](https://github.com/philomathdan/Nand2Tetris)**
>
> My notes and solutions for the course at http://nand2tetris.org/ .

---

<div class="post-metadata">

### Author: ![Dave](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dave/32/471_2.png) [@Dave](https://forum.codeselfstudy.com/u/Dave)
#### Post date: [May 1, 2018, 8:26am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/15 "2018-05-01T08:26:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [May 1, 2018, 4:26pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/16 "2018-05-01T16:26:48Z")

</div>

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.” 😑 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.

---

<div class="post-metadata">

### Author: ![Dave](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dave/32/471_2.png) [@Dave](https://forum.codeselfstudy.com/u/Dave)
#### Post date: [November 4, 2018, 12:42am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/17 "2018-11-04T00:42:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [November 4, 2018, 2:30am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/18 "2018-11-04T02:30:05Z")

</div>

(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.

---

<div class="post-metadata">

### Author: ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)
#### Post date: [November 4, 2018, 2:57am UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/19 "2018-11-04T02:57:23Z")

</div>

There’s a copy available in the [book lending library](https://forum.codeselfstudy.com/t/code-self-study-book-lending-library/1152). If you want to take a look, let me know and I’ll bring it to a meetup.

---

<div class="post-metadata">

### Author: ![Dan](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/dan/32/4311_2.png) [@Dan](https://forum.codeselfstudy.com/u/Dan)
#### Post date: [December 14, 2018, 5:39pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/20 "2018-12-14T17:39:04Z")

</div>

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! 🙂

---

<div class="post-metadata">

### Author: ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)
#### Post date: [May 6, 2020, 7:53pm UTC](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24/21 "2020-05-06T19:53:56Z")

</div>

I’m not sure if this was mentioned in the forum yet, but this was posted in chat.  
[http://nandgame.com/](http://nandgame.com/)

[Next page](https://forum.codeselfstudy.com/t/the-elements-of-computing-systems-nand2tetris/24.md?page=2)
