book cover

The Elements lives up to its subtitle, Building a Modern Computer from First Principles, and takes you on a whirlwind tour from logic gates to user applications. In mere 344 pages, you'll learn about digital design, computer architecture, operating systems, assembler, and more. The book's hands-on ascension on the ladder of abstractions effectively presents the workings of a modern computer. It's something that could effectively be taught in primary or high school computer classes. (It might also be considered too low-level and a higher level course, such as 'Python turtles', be given instead.)

book overview

Below are some of the solutions for each chapter. Note that not all are fully optimized/minimized. For instance, checking for equality likely can't be done in fewer than 11 instructions below. Yet not all solutions have been as carefully thought out.

@SP
AM=M-1
D=M
A=A-1
D=D-M
M=-1  # equal
@END
D;JEQ
@SP
A=M-1
M=0   # not equal
(END)
  1. Boolean logic
  2. Boolean arithmetic
  3. Sequential logic
  4. Machine language
  5. Computer architecture (Hack)
  6. Assembler
  7. Virtual machine - stack arithmetic
  8. Virtual machine - flow control
  9. High level language (Jack)
  10. The compiler - syntax analysis
  11. The compiler - code generation
  12. The operating system (Sack)