The Elements of Computing Systems, second edition: Building a Modern Computer from First Principles

by: Noam Nisan (0)

A new and extensively revised edition of a popular textbook used in universities, coding boot camps, hacker clubs, and online courses.


The best way to understand how computers work is to build one from scratch, and this textbook leads learners through twelve chapters and projects that gradually build the hardware platform and software hierarchy for a simple but powerful computer system. In the process, learners gain hands-on knowledge of hardware, architecture, operating systems, programming languages, compilers, data structures and algorithms, and software engineering. Using this constructive approach, the book introduces readers to a significant body of computer science knowledge and synthesizes key theoretical and applied techniques into one constructive framework.The outcome is known known as Nand to Tetris: a journey that starts with the most elementary logic gate, called Nand, and ends, twelve projects later, with a general-purpose computer system capable of running Tetris and any other program that comes to your mind.

The first edition of this popular textbook inspired Nand to Tetris classes in many universities, coding boot camps, hacker clubs, and online course platforms. This second edition has been extensively revised. It has been restructured into two distinct parts—Part I, hardware, and Part II, software—with six projects in each part. All chapters and projects have been rewritten, with an emphasis on separating abstraction from implementation, and many new sections, figures, and examples have been added. Substantial new appendixes offer focused presentation on technical and theoretical topics.

The Reviews

This is a brilliant book. This clears a lot of the mysteries of computing systems in a very approachable way. In many ways this is a pedagogical gem and there aren't that many of them out there, believe me.What it purports to do and it does very well:- It traverses the entire stack (HW --> SW) of a minimal and yet completely functioning modern computing system and clarifies the role of each and every component of such a system. These are the same components that you'll see in the kind of industrial-strength computers that we use on a daily basis. The difference is, of course, in the level of complexity of these components. For instance, in this book you will write a minimal operating system, however, this operating system is not going to be even remotely comparable to let's say an operating system like Linux. Be that as it may, the principles that you'll learn while creating this simple operating system are the same as those upon which Linux or for that matter any operating system has been built.- There is a nice balance between theory and practice. You will not find any fluff in this book. The language is very terse, sentences are well-chosen and yet everything has been explained very clearly. The amount of theory is nicely proportional to how difficult the projects are. You will not see too much theory and then some toy projects or conversely, not enough explanation followed by impossible tasks. You are given sufficient theoretical background to carry out sufficiently ambitious projects.What this book does not claim to do and, well, it doesn't:- You will NOT create an actual physical computer by reading this book. I should clarify that, this does not mean that you can't, it simply means that this is not the principal intention of the authors. After finishing this book, you have all the knowledge you need to implement your minimal computer in actual hardware. There is no guide in the book to teach you that, but after finishing this book such a task should be relatively trivial. If that's your intention, then I'll recommend supplementing this book with another book that teaches you how to do digital design using FPGAs and one of the two major HDLs (Hardware Description Language); VHDL or Verilog. Here are some options: this is a very decent FPGA board you can purchase for your project: if all you care about is actually building a very simple physical computer using breadboards instead of FPGAs then you can read this classic: You will NOT be able to understand all the internals of a complex piece of hardware, like an Intel CPU, simply by reading this or any book, regardless of how complete and complex the book is. One thing you have to bear in mind that there is a lot of optimization that goes into for example an Intel or AMD CPU. The major source of complexity and monetary value of such CPUs is mostly these optimization technologies. The basic principles are the virtually the same, what makes an Intel CPU unquestionably superior to the CPU that you'll create in this book is the mind-boggling amount of optimization technologies that goes into an Intel CPU. You will not see any mention of deep pipelines, branch prediction, superscalar processors, out-of-order processors, register renaming, multi-threading, instruction-level parallelism or anything advanced here, so you should not expect to understand them after reading this book.Things to look forward to:There are certain decisions that have been made by the authors that as the reader I believe you should be aware of beforehand, since all of us come to this book with different expectations and you might be discouraged if you become aware of these decisions half-way through the book.The book is heavily influenced by Java and its specific implementation. What does that even mean you might say? Well Java is an (almost) purely object-oriented language that famously has a two-tier compilation process. Let's explain these two things:- Java is an (almost) purely object-oriented language:If you have done any programming with any of the so-called object oriented programming languages then you should know that object-oriented programming (OOP) is a major programming paradigm based on the concepts of "objects" and "classes", these "objects" can contain data and code: data in the form of fields, and code, in the form of procedures/functions/sub-routines. Certain languages have support for OOP, but also for other programming paradigms as well (like functional programming) and there are also those languages that are said to be "purely" OOP and that means you can't escape OOP even if you'd try. And Java is such a language. The language created and used in the second part of the book is called "Jack" which is in fact based on Java.- Java has a a two-tier compilation process:All programming languages need to be translated to machine code otherwise computers can't understand them. This process of translation is called compilation or interpretation depending on the type of programming language (compiled vs. interpreted). Among compiled programming languages we also have those languages that are directly translated/compiled to the machine code (like the C programming language) and those (like Java) that are indirectly translated to the machine language, by first being translated to an intermediary language that is supposed be understood by a so-called virtual machine (not the actual physical machine) and then that intermediary code (called bytecode) becomes translated to the actual machine language of the system. Why bother doing it that way? Many good reasons, believe me. The good thing about this is that the implementation of the virtual machine in this book is the so-called "Stack Machine" implementation, so by reading this book you will get to understand the infamous "Stack" and that will come in handy later on when you want to learn other programming languages.The last thing to know about this book is that the concept of an "operating system" occasionally bleeds into other similar concepts like the concept of a "standard library", so in a way the operating system in this book is a very minimal operating system, a very very minimal one.You should never forget that this is 200+ page book and also it's a book that is supposed to teach about the fundamentals (AKA basics) of computing systems, so you should not expect to walk out of this with your own gaming machine or something. The computer you'll built in this course is basically a proof of concept that the principles taught in the book do indeed culminate in a working computing system, as has been promised.Prerequisites: Technically there are no prerequisites for this book, however, quite a few of the projects described in the book "recommend" (read require) the student to know some higher-order programing language with support for object-oriented programming like Java, Python and so on. Although, you will still be able to complete these projects by writing some sort of pseudo-code on a piece of paper or some other alternative ways, in reality you will not get the same level of satisfaction and I would argue the same level of understanding from those projects unless you know how to implement them in an actual programming language, so I would say that for at least a few of the chapters a working programming knowledge is a prerequisite.

This is the book that I've been waiting for a long long time. It clearly explains computing principles from the ground up giving a complete perspective of all parts involved in a working computer.I would highly recommend this book for every EE and also to any SE wanting to deep dive and really understand what happens inside the computer.


I am about half way through the book, and the book, along with the supporting web site is excellent. The topic(s) being covered by the book is not new to me, it is building on knowledge that I already have, your mileage may vary for those reading this book without any such background but I believe they would also have a very positive view of the book if they follow the authors suggestions of how to read/use the book.

I been studying this book for quite some time. I now have the second edition. It explains a lot but considering their is two courses that go along with it on Coursera it sure isnt easy. Many topics are discussed such as, boolean algebra, computer gates, and much more. In the book you are encouraged to build your own computer. It goes from the physics hardware to the software level. This was a really good find as I was interested in learning how computers work. Recommended!

This book is a perfect *introduction* to the computing system. Before this book, I tried to work through CSAPP and met with lots of difficulties. This book teaches me everything I need to continue exploring the more advanced aspects of the same subject. I think every CS major should read chapter 1-6, preferably before studying anything advanced. Your life will be much easier believe me.

The Elements of Computing Systems, second edition: Building a Modern Computer from First Principles
⭐ 4.7 💛 103
kindle: $25.99
paperback: $26.88
Buy the Book