Contents

  1. Home
  2. Colophon
  3. Preface
  4. Acknowledgements
  5. Contents
  6. 1 Computer Arithmetic
    1. 1.1 Positional Notation
    2. 1.2 Binary Numbers
    3. 1.3 Addition and Subtraction
    4. 1.4 The Integers
    5. 1.5 Shifts
    6. 1.6 Summary
  7. 2 Machine Code
    1. 2.1 The von-Neumann Architecture
    2. 2.2 The RV32I ISA
    3. 2.3 The Assembler
    4. 2.4 Execution Traces
    5. 2.5 The Data Segment
    6. 2.6 Memory Segmentation
    7. 2.7 Linking
    8. 2.8 Calling Functions
  8. 3 Some Simple Algorithms
    1. 3.1 Number Conversion
    2. 3.2 The Sieve of Eratosthenes
    3. 3.3 Insertion Sort
    4. 3.4 Evaluating Polynomials with Horner’s Method
    5. 3.5 The Tortoise and the Hare
  9. 4 Introduction to C
    1. 4.1 Basics
    2. 4.2 Execution Traces
    3. 4.3 Imperative Variables
    4. 4.4 The C Memory Model
    5. 4.5 Translation Units
    6. 4.6 Number Types
    7. 4.7 Control Flow
    8. 4.8 Expressions
    9. 4.9 Calling Functions
    10. 4.10 Pointers
    11. 4.11 Examples
    12. 4.12 Dynamic Memory Management
    13. 4.13 Structs
    14. 4.14 Input and Output
    15. 4.15 Undefined Behavior
  10. 5 Algorithms and Data Structures
    1. 5.1 Lists
    2. 5.2 Trees
    3. 5.3 Hashing
    4. 5.4 Dynamic Programming
  11. 6 Formal Semantics
    1. 6.1 The Syntax of Programming Languages
    2. 6.2 The Abstract Syntax of C0
    3. 6.3 The Semantics of C0
    4. 6.4 Pointers (C0p)
    5. 6.5 Scopes (C0b)
    6. 6.6 A Simple Type System (C0t)
    7. 6.7 Summary and Further Reading
  12. 7 Testing and Verification
    1. 7.1 Functional Correctness
    2. 7.2 Failures
    3. 7.3 Testing
    4. 7.4 Verification
  13. 8 Object-Oriented Programming with Java
    1. 8.1 Compilation, Main Method, Packages
    2. 8.2 Types
    3. 8.3 Reference Types
    4. 8.4 Classes
    5. 8.5 Encapsulation
    6. 8.6 References, Aliasing, and Immutable Objects
    7. 8.7 Inheritance
    8. 8.8 Overloading Methods
    9. 8.9 The Java Collections Framework
    10. 8.10 Using Object Orientation Properly
    11. 8.11 The Expression Problem and the Visitor Pattern
    12. 8.12 Object-Oriented Programming with C
  14. 9 A Simple Compiler
    1. 9.1 A Brief Overview of Syntactic Analysis
    2. 9.2 Type Checking
    3. 9.3 Syntax-Directed Code Generation
  15. A RISC-V Assembler Reference
    1. A.1 Instruction Set Reference
    2. A.2 OS Calls
    3. A.3 Assembler Directives
  16. B ASCII Table
  17. C Course Structure
    1. C.1 I: Course Introduction
    2. C.2 R1: Computer Arithmetic
    3. C.3 R2: Computer Arithmetic
    4. C.4 M1: Introduction to Machine Code Programming
    5. C.5 M2: Simple Algorithms in Machine Code
    6. C.6 M3: Function Calls
    7. C.7 C1: Introduction to C
    8. C.8 C2: Expressions and Pointers
    9. C.9 C3: Arrays, Structs, I/O
    10. C.10 A1: Lists and Trees
    11. C.11 A2: Dynamic Programming
    12. C.12 S1: C0 Syntax and Semantics
    13. C.13 S2: Extending C0 to Pointers and Scopes
    14. C.14 S3: Correctness
    15. C.15 S4: Testing
    16. C.16 J1: Intro to Java
    17. C.17 J2: Immutable Objects, Interfaces, Subtyping
    18. C.18 J3: Abstract Classes, Object, Overriding and Overloading Methods
    19. C.19 J4: Using OO Properly, OO in C, The Expression Problem, Visitor Pattern
    20. C.20 A3: Java Collections Framework and Hashing
    21. C.21 A4: Project Specific
    22. C.22 O1: Compiler Introduction (Syntax Analysis, Static Semantics)
    23. C.23 O2: Type Checking Examples, Implementation of Type Checking
    24. C.24 O3: Syntax-Directed Code Generation
    25. C.25 V1: Hoare Logics
    26. C.26 V2: Loop Invariants and Mechanizing Verification
  18. Exercise Solutions
  19. List of Symbols
  20. Index
  21. Literature