Hardware
God gave us Nand and told us to build a computer. When we asked, 'How?' God said, 'One step at a time'
To build a computer, you'll need just one thing: a Nand logic gate. Stack enough of them together, and you'll have a computer. The first part of the book is the explanation of how that's possible.
Assuming you have written some code, you'll recognize what the following code does.
console.log("Hello World");
You may know what it does but to a computer that's all nonsense.
That's because computers don't understand much, just a bit. So a big part of building a computer is translating instructions into sequences of bits.
Achieving this is a complex task. As such, we will do what engineers do with complex tasks: divide and conquer. We will divide the task into smaller parts or modules.
We define what a module is by describing what it does and how it does it. The what is a contract that the how must fulfill or implement. Provided the implementation fulfills the contract, the implementation details are not important.
An abstraction is the separation that exists between the contract and the implementation. Abstracting implementation details is one of the beautiful big ideas of engineering.
To sum up, in order to build our computer we need a modular design. This design should define the abstraction and implementation of each module. Luckily such design is available to us as the Hack computer architecture. The first part of the book is about implementing the abstractions that form this architecture.
These abstractions are implemented by a combination of lower-level chips. These chips are themselves implemented using even lower-level logic gates. How are those gates implemented? We don't care, at this point we have reached "The First Abstraction". This abstraction separates the fields of computer science and electrical engineering.
The name for this abstraction is "Boolean Logic" and it's the starting point for us. During the first part of the book, we will tackle one abstraction at a time. We will reach key milestones such as building an Arithmetic Logic Unit and a Random Access Memory. The last abstraction of this chapter is a computer that processes instructions for the Hack architecture.
Does it sound daunting? It is not, as long as we focus on one abstraction at a time. Let's go then and have a look at "The First Abstraction":
- Boolean Logic