Lecture 0: Course Details
Expectations, timings, evaluation, and laboratory details.
Open slidesCourse overview
How humans made computation possible, from electrical signals and circuits to memory, machine language, and a working computer.
The lectures develop the underlying ideas; the laboratory turns those ideas into hardware components that students build and test.
View lecturesAt a glance
Class schedule, assessment, and the principal textbook.
Test 1: 25% · Test 2: 25% · End-semester examination: 50%
Lab work: 10% · Test 1: 25% · Test 2: 25% · End-semester examination: 40%
Each lab carries 1%; the best 10 of 11 labs are counted.Noam Nisan and Shimon Schocken, The Elements of Computing Systems: Building a Modern Computer from First Principles, The MIT Press.
Slides
Use the arrow keys or the on-screen controls to move through a lecture.
Course orientation and the human story behind chips and computation.
Expectations, timings, evaluation, and laboratory details.
Open slidesHow humans learned to control electrical signals and made computation possible.
Open slidesFrom Boolean functions to gates, Hardware Description Language, and design practice.
Boolean variables and functions, truth tables, expressions, and canonical representation.
Open slidesLogic gates, composite gates, gate specifications, and HDL.
Open slidesBoolean laws, expression simplification, truth-table verification, gate diagrams, and HDL practice.
Open slidesImplement Not, And, Or, Mux, DMux, And16, Mux16, Or8Way, Mux4Way16, and DMux4Way using Nand or any previously built gates.
Open web IDEBinary representation, arithmetic circuits, and the Arithmetic Logic Unit.
Binary numbers, word size, addition, and signed integers using two's complement.
Open slidesHalfAdder, FullAdder, Add16, Inc16, and the path from bit addition to an Arithmetic Logic Unit.
Open slidesControl bits, the ALU specification, its eighteen functions, implementation planning, and tutorial exercises.
Open slidesImplement HalfAdder, FullAdder, Add16, Inc16, and ALU using only the chips gradually built in this lab and chips from the previous week.
Open web IDEFrom time and state to registers, memory banks, and the Program Counter.
Clock cycles, Data Flip-Flops, controlled feedback, Bit, and the 16-bit Register.
Open slidesAddresses, read and write timing, RAM8, and recursive construction through RAM16K.
Open slidesControl priority, PC construction, sequential simulation, and Chapter 3 design exercises.
Open slidesImplement Bit, Register, RAM8, RAM64, RAM512, RAM4K, RAM16K, and PC using DFF and previously built chips.
Open web IDEFrom machine-language abstractions and addressing modes to Hack computation, programs, branching, symbols, and memory-mapped input/output.
Memory, processors, registers, command families, addressing modes, and an introduction to Hack's memory spaces, A, D, M, and unconditional goto.
Open slidesA- and C-instructions, computation, destination and jump fields, assembly symbols, and memory-mapped screen and keyboard access.
Open slidesWrite and test Mult.asm and Fill.asm using the assembler and CPU emulator.
Stored programs, the von Neumann model, and the construction of the Hack CPU, memory system, and complete computer.
Lab Test 1: Thursday, 3 September, 2:30–4:30 p.m. View question paper (PDF)
The stored program concept, von Neumann architecture, CPU, memory, registers, memory-mapped I/O, and the Hack platform.
Open slidesA review of Boolean logic, gates, arithmetic, the ALU, sequential logic, memory, and Hack machine language.
Students used the gates, ALU, registers, memory, and Program Counter built so far to attempt the complete Hack computer.
Complete the Hack hardware platform, then begin translating symbolic assembly programs into binary machine instructions.
Instruction decoding, ALU and destination control, jump logic, the Hack memory map, whole-computer wiring, and layered testing.
Open slidesAn introduction to the three central parts of an assembler: parsing instructions, generating binary code, and maintaining a symbol table.
Open slidesA two-hour written examination covering Boolean logic, binary arithmetic, sequential logic, Hack machine language, and computer architecture.
View question paper (PDF)Complete the Chapter 5 project by implementing and testing the Memory, CPU, and top-level Computer chips.
Complete the Hack assembler, then connect a small C program to the assembly and machine instructions executed by a real processor.
Continued from Lecture 17 by first summarizing its main ideas, then completed parsing, instruction-code generation, symbol-table construction, and symbol resolution to finish the chapter on assembly language and assemblers.
Open assembler slidesCompiled a C program that sums the numbers from 1 to 100 and prints the result, then examined both its Intel-syntax assembly and machine code.
gcc -O0 -fno-pie -S -masm=intel sum.c -o sum.s
Compile sum.c only as far as assembly and save it as sum.s. Disable optimization and position-independent code, and use Intel assembly syntax.
gcc -g -O0 -fno-pie -no-pie sum.c -o sum
Compile and link sum.c into the executable sum. Include debugging information, disable optimization, and produce a non-position-independent executable.
objdump -d -S -Mintel --disassemble=main sum
Disassemble only main from the executable, showing machine-code bytes together with source and Intel-syntax assembly instructions.
Implement the assembler in Python in two stages: first translate symbol-less programs, then add labels, variables, and predefined symbols. Verify the output using the supplied Project 6 programs and reference assembler.
View lab questionIntroduce a stack-based intermediate language and translate its arithmetic and memory-access commands into Hack assembly.
Motivated Virtual Machine (VM) code as an intermediate language between high-level programs and assembly. Introduced the stack, stack-based arithmetic and logical operations, VM memory segments, and their simulation in Hack assembly.
Studied local, argument, static, this, that, temp, and pointer, then translated push constant 5, push local i, and pop local i into Hack assembly.
Completed the translation of push and pop for every VM memory segment and prepared the implementation plan for the first VM-translator laboratory.
Implement stack arithmetic, logical commands, and memory access in Python; translate the Project 7 VM programs into Hack assembly and test the results using the VM and CPU emulators.
View lab questionComplete the VM language by translating branching, function calls, returns, stack frames, and multi-file programs into Hack assembly.
Studied loops and the VM program-flow commands label, goto, and if-goto, including their translation into Hack assembly labels and conditional or unconditional jumps.
Translated function declaration, call, and return commands. Used the stack to preserve return addresses and the caller's LCL, ARG, THIS, and THAT segment pointers.
Worked through translations from the laboratory's VM programs to Hack assembly, with emphasis on program flow, function-call frames, return handling, and multi-file programs.
Extend the Project 7 translator with program flow, functions, calls, returns, directory translation, and bootstrap code; test it with the supplied Project 8 programs.
View lab questionMove from VM code to a high-level language: read Jack syntax, use its operating-system services, and build small interactive programs.
No lecture was held on Monday.
Introduced the syntax of the Jack programming language: classes, variables, subroutines, statements, expressions, and program structure.
Held in the laboratory. Explored the operating-system calls available to Jack programs, then wrote programs for Hello World, factorial calculation and input, drawing a circle inside a square, and—as a challenge—an arrow-key-controlled rotating cube.
Form a team of at most three students and build something interesting in the Jack programming language. Choose a manageable idea, divide the work, test it, and be prepared to demonstrate the result.
Build the front end of the Jack compiler: turn characters into tokens, recognize grammatical structure, and emit a testable XML representation.
Locate syntax analysis in the compiler, introduce lexical analysis, classify Jack's five token types, and specify the tokenizer's XML output and interface.
Open slidesUse context-free grammars to recognize valid programs, construct parse trees, and implement the grammar with recursive-descent routines and limited lookahead.
Apply the complete Jack grammar, represent terminals and non-terminals in XML, and organize the implementation into JackAnalyzer, JackTokenizer, and CompilationEngine.
The second theory test will be held during the regular class period.
The second laboratory test will be held during the regular laboratory period.
Thirteen weeks
Each layer will be built from parts created in the layer below it.