Computer Systems
As software engineers, we study computer systems (or computer architecture) to understand how our programs ultimately work and how the machine expects our data to be encoded. The immediate benefit is the ability to write faster, more efficient, and secure code.
In the long term, understanding computer systems provides even more benefits. Every abstraction between us and the hardware introduces leaks. This course will provide the foundational principles for creating robust mental models and more effective analysis.
We will start with how the machine encodes data, including binary representations such as text. Then we will move on to programming in C and assembly to better understand the interface provided by the computer for executing programs. Finally, we will look at two important aspects for improving program performance: using the processor microarchitecture and CPU caches (memory hierarchy).
The course will primarily consist of a sequence of tasks for each topic. You should aim to solve each task, using provided solutions and additional explanations as needed. There will also be several workshops to help connect the topics.
Watch Online Computer Systems
# | Title | Duration |
---|---|---|
1 | 001 Protobuf varint | 57:40 |
2 | 002 CSS color convert | 36:18 |
3 | 003 Beep beep boop | 28:15 |
4 | 004 Image rotate | 57:51 |
5 | 005 TCP SYN flood | 52:53 |
6 | 006 UTF-8 truncate | 25:31 |
7 | 007 Sneaky NaN | 26:34 |
8 | 008 Unsigned integers alternatives and overflow (sorry maam) | 01:05:34 |
9 | 009 Signed integers integers in JavaScript and ones complement Internet checksum | 01:15:41 |
10 | 010 Floating point IEEE754 structure and safe integers in floats in JavaScript | 01:10:39 |
11 | 011 Unicode UTF-8 UTF-32 and ugh UTF-16 | 01:34:22 |
12 | 012 What are standard in and standard out | 02:44 |
13 | 013 Why does a byte have values 0255 | 04:13 |
14 | 014 What do bigendian and littleendian mean | 08:08 |
15 | 015 Why masking low order bits is like modulus of a power of 2 | 35:42 |
16 | 016 Why do we care about teletype machines | 01:29 |
17 | 017 Why are some bitwise operations faster than arithmetic equivalents | 07:44 |
18 | 018 What are file descriptors 0 1 and 2 | 03:40 |
19 | 019 What does it mean for a value to be a certain number of bits | 09:20 |
20 | 020 What are signed and unsigned integers | 10:34 |
21 | 021 Why do I sometimes see the sequence rn for a newline | 04:05 |
22 | 022 What does it mean to flush a buffer | 02:17 |
23 | 023 Whats the basic difference between UTF8 UTF16 and UTF32 | 09:25 |
24 | 024 Why does one byte correspond to two hexadecimal digits | 02:34 |
25 | 025 Whats the difference between Unicode and something like UTF8 | 01:54 |
26 | 026 How to remember all the powers of two | 03:49 |
27 | 027 How do I read a hexdump | 06:02 |
28 | 028 What is a byte exactly | 02:21 |
29 | 029 How does UTF-8 encode characters (aka artisinal Unicode sandwich) | 10:03 |
30 | 030 What is a file descriptor | 01:58 |
31 | 031 What exactly is hexadecimal | 06:13 |
32 | 032 What do bitwise and or xor and not do | 08:05 |
33 | 033 Whats the point of floating point | 12:31 |
34 | 034 What is the effect of shifting bits | 03:57 |
35 | 035 How are IEEE 754 floating point numbers encoded (aka why is 01 02 030000000000000004) | 20:06 |
36 | 036 Hello World | 14:36 |
37 | 037 Bitcount | 23:41 |
38 | 038 Fast pangram | 34:11 |
39 | 039 Dynamic array | 43:15 |
40 | 040 Varint C extension | 50:32 |
41 | 041 Basic hashmap | 01:21:48 |
42 | 042 How do C compilers differ | 05:14 |
43 | 043 What is a register | 06:41 |
44 | 044 The generic pointer (void) in C | 16:22 |
45 | 045 Helping Max rotate bits right | 21:05 |
46 | 046 Loop syntax in C | 05:55 |
47 | 047 The C pre-processor macros and conditional inclusion | 06:13 |
48 | 048 A brief overview of structs in C | 15:43 |
49 | 049 A brief introduction to Valgrind | 16:24 |
50 | 050 Type definitions and literals in C | 12:07 |
51 | 051 A brief overview of malloc and related functions | 05:26 |
52 | 052 A brief tour of LLDB | 33:27 |
53 | 053 What happens in the compilation pipeline | 10:12 |
54 | 054 What is the effect of the compiler optimization level flag | 03:43 |
55 | 055 Overview of pointers and arrays in C | 14:45 |
56 | 056 Helping Jessica understand void | 39:35 |
57 | 057 Assembly Hello world | 31:54 |
58 | 058 Sum to N | 46:27 |
59 | 059 Matrix access | 15:47 |
60 | 060 x8664 pangram | 17:09 |
61 | 061 Binary convert | 09:48 |
62 | 062 Cone volume | 11:13 |
63 | 063 Low level recursion | 26:14 |
64 | 064 The System V AMD64 calling convention | 08:41 |
65 | 065 Explaining the terms computer architecture instruction set and microarchitecture | 04:27 |
66 | 066 Whats the difference between Intel and ATT assembly syntax | 08:38 |
67 | 067 What are the general purpose registers in x8664 | 11:37 |
68 | 068 What is the fetchdecodeexecute cycle | 13:06 |
69 | 069 Faster sum | 23:21 |
70 | 070 Color quantizing | 40:57 |
71 | 071 Moving beyond the simple fetchdecodeexecute model | 32:35 |
72 | 072 Grayscale speedup | 10:35 |
73 | 073 Pointer chase | 29:05 |
74 | 074 Bogosum | 01:00:15 |
75 | 075 What is a cache line (brief explanation) | 02:16 |
76 | 076 Understanding CPU caches | 33:24 |
77 | 077 Why are there multiple levels of CPU cache | 13:47 |
78 | 078 Measuring cache performance with perf and cachegrind | 13:25 |