The Elements of Computing Systems (From NAND to Tetris)
The Elements of Computing Systems (From NAND to Tetris) : Designing elementary logic gates from a NAND gate using Hardware Description Language
This is the first section of this course. In this section, we will first understand how this course is structured, then we will install the necassary software, and then start with the task of building basic logic gates using the primitive NAND gate, and HDL (Hardware Description Language).
If you have purchased the book, then please read the Preface, Introduction, and Chapter 1.
If you have not yet bought the book, then you can read the contents of these chapters online.
Resources:
The hardware simulator
In this course, we will be building a computer from the ground up, using HDL, and a hardware simulator. The hardware simulator can be downloaded here. This page contains further details of the hardware simulator.
HDL Reference
To do most of the homework in this section, you will need to know how to use HDL. If you have the book, it contains an HDL reference in Appendix A. If you do not have the book yet, you can get the contents from this pdf.
Submitting Responses to Activities
At diycomputerscience.com, we normally encourage participants to blog their solutions to various course activities, and submit links to their blog posts for peer review. However, this course is based on a book, which is often used in university courses. For that reason, as well as for preserving the experience of future learners, the authors have requested that we follow the code sharing guidelines stated below. I request all course participants to co-operate with the code sharing policy stated below. Very soon I will create a private pastebin for this course where everyone is encouraged to post their solution code for peer review.
Code Sharing Policy: We developed this course and made all its materials freely available because we want as many people in the world to learn computer science on their own terms. We believe that students and self-learners who set out to do the hardware and software projects should have the benefit and challenge of doing original work, without seeing published solutions. Therefore, we request that you don't post solutions publicly on the web, e.g. in blogs or forums. If your course instructor or organizer creates a private space in which students can share their work outside the public domain, that's fine. Likewise, you can share your work with others using a password-protected space. Please use your judgment and help ensure that many more students, like you, will be able to fully benefit from this learning experience. Thx – Noam Nisan and Shimon Schocken
Activities
This session has the following activities. Please complete them and submit links to your work. A good place to publish your activities is your blog, website, some wiki, or any publicly accessible page on the Internet.
Activity 1 : Download and install the TECS Hardware Simulator
Once you have successfully installed it. You are encouraged to read chapters 1, 2, and 3 of the tutorial for the hardware simulator.
Everyone is encouraged to blog their notes and submit links to their blog posts, using the form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 2 : TECS - Build a NOT gate
In this activity you have to build a NOT gate, using the primitive NAND gate.
Resources
- A template script for the NOT gate... you have to fill in the details
- The test script for the NOT gate
- The compare file for the NOT gate
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 3 : TECS - Build an AND gate
In this activity you have to build an AND gate, using the primitive NAND gate.
Resources
- A template script for the AND gate... you have to fill in the details
- The test script for the AND gate
- The compare file for the AND gate
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 4 : TECS - Build an OR gate
In this activity you have to build an OR gate, using the primitive NAND gate.
Resources
- A template script for the OR gate... you have to fill in the details
- The test script for the OR gate
- The compare file for the OR gate
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 5 : TECS - Build an XOR gate
In this activity you have to build an XOR gate, using one or more of these gates (NAND, AND, OR).
Resources
- A template script for the XOR gate... you have to fill in the details
- The test script for the XOR gate
- The compare file for the XOR gate
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 6 : TECS - Build a MUX
In this activity you have to build a MUX, using one or more of these gates (NAND, AND, OR, XOR).
Resources
- A template script for the MUX ... you have to fill in the details
- The test script for the MUX
- The compare file for the MUX
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 7 : TECS - Build a DMUX
In this activity you have to build a DMUX, using one or more of these (NAND, AND, OR, XOR, MUX).
Resources
- A template script for the DMUX ... you have to fill in the details
- The test script for the DMUX
- The compare file for the DMUX
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 8 : TECS - Build a 16 bit NOT
In this activity you have to build a 16 bit NOT, using one or more of these (NAND, AND, OR, XOR, MUX, DMUX).
Resources
- A template script for the 16 bit NOT ... you have to fill in the details
- The test script for the 16 bit NOT
- The compare file for the 16 bit NOT
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 9 : TECS - Build a 16 bit AND
In this activity you have to build a 16 bit AND, using one or more of these (NAND, AND, OR, XOR, MUX, DMUX).
Resources
- A template script for the 16 bit AND ... you have to fill in the details
- The test script for the 16 bit AND
- The compare file for the 16 bit AND
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 10 : TECS - Build a 16 bit OR
In this activity you have to build a 16 bit OR, using one or more of these (NAND, AND, OR, XOR, MUX, DMUX).
Resources
- A template script for the 16 bit OR ... you have to fill in the details
- The test script for the 16 bit OR
- The compare file for the 16 bit OR
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 11 : TECS - Build a 16 bit MUX
In this activity you have to build a 16 bit MUX, using one or more of these (NAND, AND, OR, XOR, MUX, DMUX, 16-NOT, 16-AND, 16-OR).
Resources
- A template script for the 16 bit MUX ... you have to fill in the details
- The test script for the 16 bit MUX
- The compare file for the 16 bit MUX
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 12 : TECS - Build an 8 Way OR
In this activity you have to build an 8 Way OR, using one or more of the gates/chips you have built until now.
Resources
- A template script for the 8 way OR ... you have to fill in the details
- The test script for the 8 way OR
- The compare file for the 8 way OR
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 13 : TECS - Build a 16 bit / 4 Way MUX
In this activity you have to build a 16-bit/4-way MUX, using one or more of the gates/chips you have built until now.
Resources
- A template script for the 16-bit/4-way MUX ... you have to fill in the details
- The test script for the 16-bit/4-way MUX
- The compare file for the 16-bit/4-way MUX
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 14 : TECS - Build a 16 bit / 8 Way MUX
In this activity you have to build a 16-bit/8-way MUX, using one or more of the gates/chips you have built until now.
Resources
- A template script for the 16-bit/8-way MUX ... you have to fill in the details
- The test script for the 16-bit/8-way MUX
- The compare file for the 16-bit/8-way MUX
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 15 : TECS - Build a 4 Way DMUX
In this activity you have to build a 4-way DMUX, using one or more of the gates/chips you have built until now.
Resources
- A template script for the 4-way DMUX ... you have to fill in the details
- The test script for the 4-way DMUX
- The compare file for the 4-way DMUX
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
Activity 16 : TECS - Build an 8 Way DMUX
In this activity you have to build a 8-way DMUX, using one or more of the gates/chips you have built until now.
Resources
- A template script for the 8-way DMUX ... you have to fill in the details
- The test script for the 8-way DMUX
- The compare file for the 8-way DMUX
Test your work in the hardware simulator, and ensure it works by testing it with the test script specified above. Blog your notes, and submit a link to your blog post, using the submit form below.
If you are enrolled in this course, then please login to submit your response to this activity
- http://twitter.com/iamfritch submitted an activity response for activity 'TECS - Build a 16 bit OR' ... May 9, 2013
- http://twitter.com/iamfritch submitted an activity response for activity 'TECS - Build a 16 bit AND' ... May 9, 2013
- http://twitter.com/iamfritch submitted an activity response for activity 'TECS - Build a 16 bit NOT' ... May 9, 2013
- http://twitter.com/iamfritch submitted an activity response for activity 'TECS - Build an XOR gate' ... May 8, 2013
- http://twitter.com/iamfritch submitted an activity response for activity 'TECS - Build an OR gate' ... May 8, 2013
- http://twitter.com/iamfritch submitted an activity response for activity 'TECS - Build an AND gate' ... May 6, 2013
- http://twitter.com/iamfritch submitted an activity response for activity 'TECS - Build a NOT gate' ... May 5, 2013
- http://twitter.com/iamfritch submitted an activity response for activity 'Download and install the TECS Hardware Simulator' ... May 5, 2013
- http://twitter.com/iamfritch submitted an activity response for activity 'Download and install the TECS Hardware Simulator' ... May 5, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 16 bit Incrementer' ... Feb 5, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 16 bit Adder' ... Feb 5, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a Full Adder' ... Feb 5, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a Half Adder' ... Feb 5, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build an 8 Way DMUX' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 4 Way DMUX' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 16 bit / 8 Way MUX' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 16 bit / 4 Way MUX' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build an 8 Way OR' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 16 bit MUX' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 16 bit OR' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 16 bit AND' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a 16 bit NOT' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a DMUX' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a MUX' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build an XOR gate' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build an OR gate' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build an AND gate' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'TECS - Build a NOT gate' ... Feb 4, 2013
- http://twitter.com/AdamMBritt submitted an activity response for activity 'Download and install the TECS Hardware Simulator' ... Feb 4, 2013
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build an ALU' ... Dec 12, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 16 bit Incrementer' ... Dec 12, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 16 bit Adder' ... Dec 12, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a Full Adder' ... Dec 12, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a Half Adder' ... Dec 12, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build an 8 Way DMUX' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 4 Way DMUX' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 16 bit / 8 Way MUX' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 16 bit / 4 Way MUX' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build an 8 Way OR' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 16 bit MUX' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 16 bit OR' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 16 bit AND' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a 16 bit NOT' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a DMUX' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a MUX' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build an XOR gate' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build an OR gate' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build an AND gate' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'TECS - Build a NOT gate' ... Dec 5, 2012
- http://twitter.com/nimbledodo submitted an activity response for activity 'Download and install the TECS Hardware Simulator' ... Dec 5, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Write an IO bound program using our assembly language' ... Dec 2, 2012
- http://twitter.com/rvdkooy submitted an activity response for activity 'TECS - Build an ALU' ... Nov 28, 2012
- http://twitter.com/rvdkooy submitted an activity response for activity 'TECS - Build a 16 bit Incrementer' ... Nov 28, 2012
- http://twitter.com/rvdkooy submitted an activity response for activity 'TECS - Build a 16 bit Adder' ... Nov 28, 2012
- http://twitter.com/rvdkooy submitted an activity response for activity 'TECS - Build a Full Adder' ... Nov 28, 2012
- http://twitter.com/rvdkooy submitted an activity response for activity 'TECS - Build a Half Adder' ... Nov 28, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Write a assembly language program to multiply two numbers' ... Nov 23, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Get familiar with the assembler and CPU emulator' ... Nov 23, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16-bit Program Counter' ... Nov 23, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16-bit / 16384-register memory' ... Nov 23, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16-bit / 4096-register memory' ... Nov 23, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16-bit / 512-register memory' ... Nov 22, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16-bit / 64-register memory' ... Nov 22, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16-bit / 8-register memory' ... Nov 22, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit register' ... Nov 22, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 1 bit binary cell' ... Nov 22, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build an 8 Way DMUX' ... Nov 22, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a 4 Way DMUX' ... Nov 22, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build an ALU' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit Incrementer' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit Adder' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a Full Adder' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a Half Adder' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build an 8 Way DMUX' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 4 Way DMUX' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit / 8 Way MUX' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit / 4 Way MUX' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build an 8 Way OR' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit MUX' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit OR' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit AND' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a 16 bit NOT' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a DMUX' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a MUX' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build an XOR gate' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build an OR gate' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build an AND gate' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'TECS - Build a NOT gate' ... Nov 21, 2012
- http://twitter.com/davidosmith submitted an activity response for activity 'Download and install the TECS Hardware Simulator' ... Nov 21, 2012
- http://twitter.com/sairajeshwari reviewed a response submitted for activity 'TECS - Build a 4 Way DMUX' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a 16 bit / 8 Way MUX' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a 16 bit / 4 Way MUX' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build an 8 Way OR' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a 16 bit MUX' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a 16 bit OR' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a 16 bit AND' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a 16 bit NOT' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a DMUX' ... Nov 21, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build a MUX' ... Nov 20, 2012
- http://twitter.com/sairajeshwari submitted an activity response for activity 'TECS - Build an XOR gate' ... Nov 20, 2012


