Computing Systems
Bits, logic circuits, memory, the von Neumann model, the LC-3 ISA, assembly and C.
Textbook: Patt & Patel, Introduction to Computing Systems (2nd edition), MGraw Hill, 2004. ISBN 0-07-121503-4 (required)
- Week 1Introduction to a Computer System
- The computer system, abstraction and levels of transformationThe seven levels that take a problem down to electrons, the idea of abstraction, and the difference between ISA and microarchitecture. A map of the rest of the course, and short-answer questions on the midterm.
- Week 2Bits, Data Types, and Operations
- Bits and integers: 2's complement, overflow, sign extensionReading a bit pattern as unsigned, sign-magnitude, 1's and 2's complement, binary/hexadecimal conversions, 2's complement addition and subtraction and the overflow rule. The part of the midterm worth the most points.
- Bitwise operations, IEEE 754 floating point and ASCIIBit masks with AND/OR/XOR/NOT, the recipe for encoding and decoding IEEE 754 single precision, and ASCII character codes. Each is a guaranteed question on the midterm.
- Week 3Digital Logic Structures (logic gates, combinational logic circuits)
- Transistors, logic gates and Boolean algebraFrom the MOS transistor to CMOS gates, from the truth table to the SOP expression, minterms/maxterms and simplification with Boolean algebra. Circuit reading and simplification questions come from here.
- Combinational circuits: decoder, mux, full adder, PLADecoder, multiplexer, full adder and the ripple-carry adder, and building any function with a PLA. Everything you need for short-answer and tracing questions.
- Week 4Digital Logic Structures (concept of memory, sequential logic circuits)
- Memory and sequential logic: latch, flip-flop, register, FSMTracing the R-S latch and the gated D latch, registers, memory address calculation (address space, addressability), the clock, flip-flops and finite state machines. Short-answer and tracing questions.
- Week 5The von Neumann Model (instruction processing)
- The von Neumann model and the instruction cycleThe five parts of a computer, the jobs of PC/IR/MAR/MDR and the six phases of an instruction (FETCH, DECODE, EVALUATE ADDRESS, FETCH OPERANDS, EXECUTE, STORE RESULT). With LC-3 examples.
- Week 6The von Neumann Model (I/O basics)
- I/O basics: memory-mapped I/O and pollingHow the keyboard and the display are connected to the LC-3: the KBSR/KBDR/DSR/DDR registers, the ready bit, the polling loop, the difference from interrupts and an introduction to TRAP service routines.
- Week 7ISA Overview (Memory organization and registers)
- LC-3 ISA: memory, registers, operate and data movement instructionsThe LC-3's memory layout, registers and condition codes; the ADD/AND/NOT and LD/LDI/LDR/LEA/ST/STI/STR instructions, addressing modes and encoding and decoding 16-bit machine code by hand.
- Week 8ISA Overview (Memory organization and registers)
- LC-3 control instructions: BR, JMP, TRAP and loopsThe BR instruction that looks at the condition codes, offset calculation, JMP/RET and TRAP; counter and sentinel loops, the if/else pattern, and reading and tracing a program from hex machine code.
- Week 9Review for the Midterm Exam
- Midterm review: numbers, logic, memory, von Neumann, LC-3A one-page summary of weeks 1-8, the exam recipe for each topic and mixed practice questions. Start here the evening before the exam.
- Week 10Assembly Language
- LC-3 assembly language: directives, the two-pass assembler, the symbol tableLabels, .ORIG/.FILL/.BLKW/.STRINGZ/.END, the two passes of the assembler and the symbol table; complete programs with loops, string processing and subroutines (JSR/RET), and their outputs.
- Week 11Programming in C
- Introduction to C: variables, types and operatorsThe structure of a C program, int/char/double, scope, integer division, ++/--, logical and bitwise operators, precedence. The foundation of “What is printed?” questions.
- C control structures: if, switch, while, for, do-whileDecision and loop structures, break/continue, fall-through in switch, common traps (= inside an if, the dangling else, ; after a for) and their counterpart in LC-3 branches.
- Week 12Programming in C
- C functions, the runtime stack and recursionFunction definition, call by value, static local variables, the activation record on the LC-3 (R5 frame pointer, R6 stack pointer) and tracing recursive functions.
- Week 13Programming in C
- Pointers, arrays and strings in CThe address (&) and content (*) operators, pointer diagrams, swapping with pointers, arrays and pointer arithmetic, passing an array to a function, null-terminated strings and the LC-3 memory layout.
- Week 14Programming in C
- struct, dynamic memory and I/O in C (printf, scanf)struct and typedef, passing a struct by value and by pointer, the -> operator, arrays of structs, linked lists, malloc/free and the printf/scanf format specifiers. End-of-semester C questions.