What you’ll achieve:
In this project-centered course* you will build a modern computer system, from the ground up. We’ll divide this fascinating journey into six hands-on projects that will take you from constructing elementary logic gates all the way through creating a fully functioning general purpose computer. In the process, you will learn - in the most direct and constructive way - how computers work, and how they are designed.
What you’ll need:
This is a self-contained course: all the knowledge necessary to succeed in the course and build the computer system will be given as part of the learning experience. Therefore, we assume no previous computer science or engineering knowledge, and all learners are welcome aboard. You will need no physical materials, since you will build the computer on your own PC, using a software-based hardware simulator, just like real computers are designed by computer engineers in the field. The hardware simulator, as well as other software tools, will be supplied freely after you enroll in the course.
Course format:
The course consists of six modules, each comprising a series of video lectures, and a project. You will need about 2-3 hours to watch each module's lectures, and about 5-10 hours to complete each one of the six projects. The course can be completed in six weeks, but you are welcome to take it at your own pace. You can watch a TED talk about this course by Googling "nand2tetris TED talk".
*About Project-Centered Courses: Project-centered courses are designed to help you complete a personally meaningful real-world project, with your instructor and a community of learners with similar goals providing guidance and suggestions along the way. By actively applying new concepts as you learn, you’ll master the course content more efficiently; you’ll also get a head start on using the skills you gain to make positive changes in your life and career. When you complete the course, you’ll have a finished project that you’ll be proud to use and share.

レビュー

RQ

One of the best courses I have taken on Coursera. I feel much more knowledgable about the lower-level workings of computers now. I hope at some point Coursera offers the second part of the course.

PK

Jan 27, 2019

Filled StarFilled StarFilled StarFilled StarFilled Star

This was just a wonderful course - exciting, challenging, well organized, and a ton of fun. I really enjoyed every week of it and will recommend it to friends. Thanks so much to Shimon and Noam!

レッスンから

Memory

Having built the computer's ALU, this module we turn to building the computer's main memory unit, also known as Random Access Memory, or RAM. This will be done gradually, going bottom-up from elementary flip-flop gates to one-bit registers to n-bit registers to a family of RAM chips. Unlike the computer's processing chips, which are based on combinational logic, the computer's memory logic requires a clock-based sequential logic. We will start with an overview of this theoretical background, and then move on to build our memory chipset.

講師

Shimon Schocken

Noam Nisan

字幕

The last chip that we have to build in this week is called counter and before we set out to describe the counter, I'd like to say a few words about the context in which counters come to play. So, let us assume that they have a domestic robot in my home and I want to cause this robot to bake some brownies for me. So here's what I'm going to do. I'm going to write a very specific program consisting of something like 50 instructions that tell the robot exactly how to bake these brownies. And I'm going to mount this recipe on the kitchen wall and next to the recipe, I'm going to put a counter that emits a number that tells the robot which instruction the robot has to execute next. So it will begin with the number zero because my instructions are numbered from zero to 49, and the contract is going to be as follows, when the robot carries out set of instructions. At the end of this cycle, if you will, the counter increments by one. And then the robot takes a look at the counter and the robot sees that it has to execute instruction number one. It executes instruction number one. Counter becomes two, executes instruction number two, and so on. Now, in addition to this basic increment, I also want to be in full control of the situation, so I also want to be able to come in and change the counter to a specific number, like 17. Irrespective of what the counter shows now, three, four, five, whatever it is, I want to Come in and put the number 17 instead. And then have the counter continue to count from 17 onward. Now this is very important because suppose that the robot finished baking the brownies and I want to now bake another set of brownies. Well, in order to do this I can go to the counter and put the number zero in it and this will cause The robot to start from the beginning. Now, another reason why we want to set the content to some other values is because you know when the robot starts to bake the second batch of brownies, the oven is already warm. So we have to skip the whole set of instructions that tell the robot how to turn on the oven. So the first instruction in the program will probably be something like, if the oven is working go to instruction 11 or something else. Skip all the instructions that deal with turning on the oven. That's another reason why we want to be able to set the counter to a particular value. So we see that basically we have to support three generic or primitive operations which are as follows. Fetch the first instruction, in order to do this we want to set The program counter to zero. The other operation which is kind of the default operation is fetch the next instruction, and in order to do this, we have to be able to increment the current state of the counter by one. And finally, we want to be able to go to a particular instruction, fetch and execute it, and in order to do this, we have to be able to set the program counter to some desired value. So what is a counter? The counter is a chip, a hardware device, that somehow realizes this abstraction, that somehow supports these three primitive operations. So let's talk about this abstraction in more detail. And I'm going to use the same chip diagrams that we used earlier in other units in this course. So we have a black box description of a program counter. We see that we have 16-bit input coming in, containing a certain 16-bit value. We have a 16-bit output going out. And we also have three control bits which are called load, inc and reset. Inc stands for increment. Now, how does this thing is supposed to work? Well, here's a more formal description of the desired operation of this 16-bit counter. If the reset bit equals one, if the reset bit is asserted, well in that case, I want the counter to emit zero. So, in the next cycle, the counter will emit the number zero. If the load bit is asserted, well in that case I want to set the counter to a particular value. So if I want the counter to go to number 17, well, I put the number 17 or in binary. I put the 16-bit value that represents 17 in the input, and I assert the load bit. This will bypass the regular increment of the counter and it will set the counter to the number 17 in the next cycle. And if inc equals one, if the inc bit is asserted, well, in that case, the output of the counter will be the current state of the counter, plus one. This is a default operation of the counter. And finally, if none of these control bits is asserted, the counter does nothing, it emits its current state. So, this is the desired functionality of the counter and your job is to write the necessary HDL statements that will actually realize this desired functionality. Now, if you don't see how to do it, don't worry about it because we're going to have a complete unit dedicated to project three. And in this unit, we're going to talk about various tips and guidelines On how to build every chip including this counter chip. Now, before we go on to talk about this unit, I'd like to give you an example of how the counter chip actually operates using our hardware simulator. So this is what we're going to do next. To get started we load the program counter, built-in chip. So we go to the tools folder and we look for built-in chips. And inside the built in chips, we search the program counter .hdl file. Here it is. This is a built-in chip and we see that it has a GUI side effect that shows the contents of the program counter, which is essentially a register with some control bits. And indeed, we see that it has a 16-bit input, a 16-bit output and three control bits named load, inc, and reset. So, let us load some value into the program counter. So, we want to put in the number 23. We have to run the clock in order to commit this value. But we see that actually nothing happens. We are running the clock, nothing seems to happen. And nothing seems to happen because we forgot to assert the load bit. So, let us assert the load bit and run the clock. And indeed, we see that the program counter now contains 23, but it doesn't really count everything, does it? It seems to be fixed on 23. Well, it's fixed because we forgot to assert the inc load width. So let us do that. We assert the inc load width, and still nothing seems to happen. Well, nothing seems to happen because in every cycle we do two things. We tell the register, the program counter to increment but we also load it with 23 in every cycle, so it stays at 23. So if we want the program counter to finally count anything. We have to turn off the load bit, run the clock, and finally it looks like we are cooking with gas. The program counter advances in every cycle by one. And this is the classical operation of a program counter. In fact, we can click the fast forward icon. And this will do sort of an infinite loop that runs the clock forward. And we see that indeed, in every cycle, the program counter advances by one. Very nice, let's stop the clock and let us reset the program counter. So, we set the reset bit one and we hope the program counter will turn to zero. And let's run the clock, and indeed we see that in the next cycle, the program counter is zero. Well, it doesn't count again, because reset is still one. So we have to turn off the reset bit and run the clock, and we see that now indeed, the program counter progresses nicely in every cycle. So, this has been a demo of the program counter. And let's go back to the lecture. So, this is the end of the unit that describes how to build a counter. And actually, this is the end of the description of all the chips that we're going to build this week. And in the next unit, we're going to give you all sorts of tips and guidelines on how to build these chips and how to submit project three.