Book notes — Computer systems: A programmer's perspective

Created at: September 1, 2021.
Last updated at: September 2, 2021

Before we start

I've had this book for a few years now, but never really got around reading it. I first heard of it during a stream by Abner Coimbre, where someone asked about any books to learn computer fundamentals. It seemed interesting so I got a copy. I've finally decided to read it.

Chapter 1

This is a light introduction to computer systems. The authors start with the classic Hello, World! program in C. They provide a brief overview of how that text file with the program gets transformed until it is finally executed by the CPU. They use that as a pretext to dive into how computers are organized, talking about the CPU, caches, bus, main memory, storage, etc. I enjoyed the approach take. It makes the text helpful for beginners.

There's also some discussion about operating systems, their role, and what they provide to programs. But my favourite part was the introduction of Amdahl's Law. I was familiar with the idea itself, but had never seen it formalized and examplified like in this book.

Amdahl's Law effectively lets us calculate the effective speed up on the whole system when we improve part of it. The gist of it is to understand that you only get significant system-wide speed ups if you improve a large portion of it. The exercises at the end of the chapter help fixate the idea. I enjoyed solving the two exercises since they were not computer related and served to prove the point of how general this law is.

Chapter 2

This chapter mostly covers how data gets represented in computers. The text covers number of bytes used to represent common data types, byte ordering (endianness), two's complements, etc. What I like in particular is how the authors used mathematical formulas to explain how things like shifts and two's complements work. I don't recall seeing it explaining like that in university. This approach is a lot better from my point of view. It makes things really clear.