Learning objectives
By the end you can:
- Define a bit, a byte, a word, and a memory address, and describe the two regions of memory every running program uses (the stack and the heap) stating what lives in each and why the two have opposite lifetimes and opposite failure modes.
- Represent a small integer in binary, explain two's complement and why every modern CPU uses it instead of sign-magnitude, and predict exactly how and where a fixed-width integer overflows and wraps around.
- State what endianness is (byte order) and why a raw byte-level tool like
DataViewforces you to say which one you mean, where an ordinary C variable's byte order is normally invisible. - Describe the three fields of an IEEE-754 floating-point number (sign, exponent, mantissa) and use that structure to explain, mechanically (not as folklore) why an ordinary decimal like
0.1has no exact binary representation, and predict which comparisons and sums this breaks. - Distinguish a Unicode code point from a byte, tell the ASCII → Unicode → UTF-8 story accurately, and compute the UTF-8 byte length of a string by hand, directly from its code points.
- Trace the compile → assemble → link → load → run pipeline for a compiled language, stating what each stage does and which single category of error each stage, and only that stage: is capable of catching.
- Read a short C program using pointers, arrays, and structs, and correctly predict its printed output, its
sizeof, or its undefined-behavior failure mode, by tracing alone, never by compiling. - Use Python's own introspection tools (
id,is,sys.getsizeof) to observe CPython's memory model directly and correctly: object identity versus equality, aliasing, small-integer caching versus compile-time constant folding, and the mutable-default-argument trap. - Use JavaScript typed arrays (
Int32Array,Float64Array,DataView) as a live, executable window into raw fixed-width memory, the typed, statically-sized contrast to Python's dynamic, arbitrary-precision model. - (Productivity objective: R10 duality.) Use an AI coding copilot, under the Copilot Discipline, to accelerate tracing unfamiliar low-level code and diagnosing memory-model bugs, while never letting it substitute for your own by-hand trace or your own hidden-test verification.
- State, from memory, exactly where this module's authority ends: CS1.04 takes the call stack introduced here and asks how deep and how expensive it is to use (recursion analysis, Big-O, growth rates); this module owns what the stack physically is, never how expensive it is to use it, that hand-off is deliberate, not an oversight.
The duality, stated once (R10). This module carries two objectives at once, as every module in this region does. The understanding objective (items 1–9 and 11) is what the mastery gate rewards: you earn it by tracing memory by hand and predicting behavior before you ever run anything. The productivity objective (item 10) is the payoff you keep: knowing how to let a copilot accelerate the tedious parts of reading someone else's low-level code, while your own by-hand understanding is what catches the copilot when it is confidently wrong about an address, a byte count, or a struct's layout. A tool can draft an explanation of a pointer; only you, having traced it yourself first, can tell whether that explanation is correct.
Prerequisites & connections
Builds on. CS1.01 (Programming from Zero. Python I) gave you values, variables, types, control flow, functions, and I/O; CS1.02 (Python II (Data Structures & Idiomatic OOP) gave you lists, dicts, tuples, sets, comprehensions, mutability, and clean classes) at the level of how to use them correctly. This module does not re-teach any of that usage. It goes one level down and answers the question CS1.02 deliberately left open every time it said "lists are mutable, dicts are mutable, strings are not", namely why, mechanically, in terms of where these objects actually live and what a Python variable actually is (a name bound to a reference to an object living somewhere on CPython's own heap, never a box that directly holds the value). No calculus, no hardware background, and no assembly language are assumed, only comfort with basic Python syntax from CS1.01/CS1.02 and ordinary binary/decimal number sense.