The study guides for Tests 2, 3, and the final are farther down the page.

This is a study guide for all of the Exams for CS429. Each test will cover material that we have discussed in class, labs, and assigned readings. Each test is closed book / closed notes, but you may bring one handwritten 8 1/2 by 11 inch sheet of notes (both sides) to the test, except for the final. You may have two such sheets for the final.

CS429 Test 1 Study Guide

Readings for Test 1

You are expected to have read the following sections of Bryant and O'Hallaron: chapter 1, chapter 2, section 4.2.

Also review all of the slidesets (including the one on C) through slideset 5.

Slideset 1: Introduction

  1. Understand why ints are not integers and floats are not reals.
  2. What is the value of knowing assembly language?
  3. Why does a programmer need to consider memory issues?

Slideset C: Basic C

  1. Know how to write simple programs in C.
  2. Understand the basic C data types.
  3. Understand at least: program structure, assignments, casting, if, while, for, function calls, basic I/O, arithmetic and logical operators.
  4. Understand the #include and #define directives.
  5. Know how to access and use command line arguments?
  6. How do you compile a program using gcc?
  7. How can you name the output file? What if you don't name it?
  8. How can you get the assembler output?
  9. How do you run your compiled program?

Slideset 2: Bits and Bytes

  1. Understand the idea of representing information as bits: integers, reals, characters, instructions.
  2. Understand packaging of bits into bytes, words, long words, etc.
  3. Know what it means to say that memory is a byte-addressable array.
  4. Understand the distinction between big-endian and little-endian, and how to represent data in either format.
  5. Understand unsigned and signed integers and their representations.
  6. Understand boolean and logical operations.
  7. Understand how finite sets can be represented by bit vectors.

Slideset 3: Integers

  1. Understand encodings of integers: unsigned and two's complement.
  2. Know how to interpret a bit string as binary, decimal or hexadecimal number.
  3. Know how to cast between signed / unsigned and what it means.
  4. Be able to do simple arithmetic (addition, subtraction, multiplication, division) with signed or unsigned values.
  5. Understand the relation between shifting and multiplication / division.
  6. Understand sign extension.

Slideset 4: Floating Point

  1. Understand the analogy of floating point to scientific notation.
  2. Understand the representation of (some) reals in floating point.
  3. Be able to translate between decimal notion and FP
  4. Understand the distinction between normalized and denormalized numbers.
  5. Understand the special values (infinities and NaNs).
  6. Be able to round using any of the four rounding modes.
  7. Know the default rounding mode.
  8. Understand why it makes sense that that one is the default.

Slideset 5: Logic Design

  1. Understand the electrical nature of bits in signals.
  2. Know the truth tables for simple logical functions: AND, OR, NOT, XOR.
  3. Be able to construct truth tables for simple logical expressions.
  4. Know the symbols for the logic gates: AND, OR, NOT, XOR.
  5. Be able to read and understand a simple logic diagram composed of gates and wires.
  6. Realize that it takes time for a signal to propogate through a circuit.
  7. Understand the logical interpretation of such a diagram.
  8. Understand the notion of hierarchical design (composing simpler circuits to form more complicated circuits).
  9. Be able to write HCL expressions corresponding to simple circuits.
  10. Understand the following circuits: bit equality, word equality, bit multiplexor, word multiplexor, 1-bit adder, 4-bit ALU.
  11. Know the difference between combinational and sequential circuits.
  12. Be able to follow the logic of simple state-holding devices: SR flip-flops, D latches,
  13. Understand how latches are combined to form registers and register files.
  14. Understand clock signals and why circuits are clocked.
Don't worry about the algebraic structures: Groups, Rings, Algebras, etc. I won't ask you about that stuff. But you should know what the properties are (e.g., associativity, commutativity, distributivity) and whether they hold for various representations.

CS429 Test 2 Study Guide

What is Covered

Test 2 is cumulative but primarily covers slidesets 6-11.

Readings for Test 2

You are expected to have read the following sections of Bryant and O'Hallaron: chapter 3 (through section 3.9).

Slideset 6: Instruction Set Architecture I

  1. Understand what the ISA.
  2. How is it an abstraction layer?
  3. Understand the components of the Y86 processor state: registers, condition codes, PC, status, memory.
  4. Know the names of the registers and the special function of the stack pointer.
  5. Understand the idea of encoding instructions into bit strings.
  6. Don't worry about memorizing any details of the Y86 encoding.
  7. Understand the program stack and how it's used by Y86 programs.
  8. Given simple Y86 code, be able to explain what it does.
  9. Understand how function calls and returns occur in Y86.
  10. How are arguments passed to functions and how is the function value returned?
  11. Understand the distinction between high level languages, assembly language and machine language.
  12. Understand abstractly what the compiler and assembler do.
  13. Know the function of assembler "directives" such as .pos, .quad, etc.
  14. Understand the Y86 stack discipline for call and return.
  15. Understand the different responsibilities of caller and callee in a procedure call.
  16. Be able to read and understand Y86 assembler examples.

Slideset 7: ISA II

  1. Understand why x86 retains many arcane and obsolete features.
  2. There is no need to know the sequence of x86 machines or their features.
  3. Understand the difference in level of abstraction between C and assembly (data types, control statements).
  4. What is an ISA and what purposes does one serve?
  5. Understand the distinction between an architecture and an implementation, and what kinds of things fall into each.
  6. Know the basic steps in turning C into an executable image in memory.
  7. Understand the notion of disassembling.
  8. Understand that there are different formats for assembly (which generate the same machine code).
  9. Know the common x86 addressing modes.
  10. Understand the x86 mov instruction format and semantics.
  11. Understand the meaning and uses of the C "*" and "&" operators.
  12. Know how to dereference pointers and create addresses.
  13. Be able to interpret x86 code at the level of the examples on the slides.
  14. Be able to execute (on paper) a simple program and explain the effect on the system state (registers, flags, etc.)
  15. Understand the distinction between movq and leaq.
  16. Know the basic arithmetic operations for x86.
  17. Know how to use leaq for basic arithmetic.

Slideset 8: ISA III

  1. Understand the x86 flags, what they mean, and what they are used for.
  2. Understand the cmp and test instructions.
  3. Know the various jumps and under what conditions they happen.
  4. It's not necessary to know the specific condition code expressions that correspond to the various jumps or sets.
  5. Understand the structure of the x86 registers (including the byte and word addressable portions).
  6. Understand how the following C constructs get compiled (if, if-else, do-while, while, for, switch).
  7. Know what a jump table is and how it can be used in compiling a switch.
  8. Understand under what conditions a switch might be compiled into if-else statements, jump tables, or something else.
  9. Know about labels and goto's in C.

Slideset 9: ISA IV

  1. Understand the structure of the x86 (IA32) stack and how it's used.
  2. Know how push and pop work and what they're used for.
  3. Understand the procedure call stack discipline (setup and tear down of stack frames, saving and restoring registers, argument passing, return address).
  4. Understand the role of %rsp.
  5. Be able to step through a procedure call and return.
  6. Know the register saving conventions (caller saved and callee saved).
  7. Know what's special about compiling recursive procedures.

Slideset 10: ISA V

  1. Understand storage allocation for arrays.
  2. Be able to convert from array notation to pointer notation.
  3. Be able to compute addresses and values of array elements.
  4. Know about bounds checking in C.
  5. Understand the guarantees of array allocation.
  6. Understand nested arrays and multi-level arrays. How do they differ?
  7. Understand the assembly level computations for accessing arrays.
  8. Understand how C structures are implemented at the assembly level.

Slideset 11: ISA VI

  1. Understand what it means to align data.
  2. Why would a compiler align data?
  3. What are the basic alignment requirements?
  4. Be able to compute alignment for structures.
  5. How might you avoid wasted space due to alignment within structs?
  6. Understand C unions and what they're good for.
  7. Be able to compute alignment for unions.
  8. Review big and little endian representations of data.

CS429 Test 3 Study Guide

What is Covered

Test 3 is cumulative but primarily covers slidesets 12-25. As usual, the test is closed book / closed notes, but you may bring one handwritten 8 1/2 by 11 inch sheet of notes (both sides) to the test.

Readings for Test 3

You are expected to have read the following sections of Bryant and O'Hallaron: section 1.9.1, sections 4.3 to 4.5.10, chapter 6, sections 5.1 to 5.8, and 7.1 to 7.10.

Slideset 12: Datapath I

  1. Understand the basic approach to designed a computer explained very briefly on the first few slides.
  2. Understand the stages of the sequential Y86 implementation, what each does, and why it's useful to consider such stages.
  3. Understand on a conceptual level how instruction execution maps onto hardware.

Slideset 13: Datapath II

  1. Be able to understand the type of flow diagrams in the slides (e.g., the Fetch Logic, etc.)
  2. Be able to read and understand HCL descriptions describing signals in the architecture.
  3. Understand how signals propogate through the architecture.
  4. Understand the limitations of a sequential (non-pipelined) implementation of any processor.
  5. Understand the notion of clocking.

Slideset 14: Pipeline I

  1. Understand the concept of pipelining and why it's useful in processor implementation.
  2. Understand the notion of sequential implementation as the execution model that a pipelined architecture must emulate.
  3. Understand pipeline stages, pipeline registers, latency and throughput.
  4. Be able to compute latency and throughput for sample pipelines (uniform and non-uniform).
  5. Know the performance equation for pipelines.
  6. Understand the notion of cycles per instruction.
  7. How does pipelining impact performance?
  8. What is a data dependency and how are they manifest?
  9. What are data hazards?
  10. What challenges do data hazards present for pipelined architectures?

Slideset 15: Pipeline II

  1. Understand the need for pipeline registers in the implemention.
  2. Know the pipeline stages in the Y86 PIPE architecture and what they do.
  3. You don't need to know all the signals or wires in PIPE.
  4. What are data hazards and control hazards?
  5. What instruction types tend to produce data/control hazards?
  6. Understand how data dependencies affect the pipeline.
  7. Understand how inserting NOPs could help.
  8. In what circumstances is predicting the PC a problem, and why?
  9. Understand the Y86 strategy for predicting the PC.
  10. How do you recover from a PC misprediction?
  11. What are the options for dealing with hazards?
  12. What is stalling and how is it implemented?
  13. What is a bubble and how is it implemented?

Slideset 16: Pipeline III

  1. What does data forwarding accomplish?
  2. What are the limitations of forwarding?
  3. What is a load/use hazard?
  4. Understand the idea of performance analysis with pipelining.
  5. Understand the factors that go into computing CPI.
  6. Why doesn't an N-stage pipeline typically speed up throughput by a factor of N?

There was no Slideset 17.

Slideset 18: Storage Technologies

  1. Understand the notions or RAM and ROM.
  2. Understand DRAM and SRAM and their relative characteristics.
  3. How is DRAM accessed?
  4. How are memory modules constructed from DRAM?
  5. Understand volatile vs. non-volatile memories.
  6. Understand what a bus does in a system and how one is accessed.
  7. Understand how rotating disks are constructed and accessed.
  8. Know how to compute disk capacity.
  9. What are the components of disk access and their relative significance?
  10. How do disks compare to DRAM and SRAM?
  11. What do logical disk blocks accomplish?
  12. Understand the basics of solid state disks and how they compare to other technologies.
  13. Understand the CPU-Memory gap and its implications.

Slideset 19: Cache I

  1. Understand the importance of locality in a program.
  2. Know the difference between spacial and temporal locality and how a program might manifest either.
  3. Be able to recognize good/bad locality in a program.
  4. What does stride-k behavior mean?
  5. Understand the basic idea of a memory hierarchy.
  6. What typically changes as you go up/down the hierarchy?
  7. Understand what caching means and why it's used.
  8. Understand: cache hit, cache miss, victim, replacement strategy, placement strategy, cold miss, conflict miss, capacity miss.

Slideset 20: Cache II

  1. Understand the fundamentals of organizing a cache memory: sets, lines, blocks, tags, valid and dirty bits.
  2. Understand how a cache is accessed given an address.
  3. Given parameters of a cache, be able to compute hits and misses from sample input.
  4. Understand direct-mapped vs. set associative caches.
  5. Understand write-back and write-through.
  6. Understand write-allocate and no-write-allocate.
  7. What factors affect average memory access time (AMAT)?
  8. How can a programmer improve performance by writing "cache-friendly" code?

Slideset 21: Optimization I

  1. What are the strengths and limitations of optimizing compilers in improving program performance?
  2. Understand code motion and when it's useful.
  3. What is reduction in strength and when is it useful?
  4. How can the programmer influence the compiler to favor registers over memory?
  5. Why is CPE a more useful measure of efficiency than absolute time?
  6. What is loop unrolling and how is it useful?
  7. Why is a procedure call often considered an "optimization blocker"?
  8. Read and understand the Vector ADT example as an exemplar of hand optimization techniques.
  9. What is memory aliasing and why is it considered an optimization blocker?
  10. Understand the notion of common subexpressions and their role in optimization.
  11. How is profiling used in code optimization? What does one look for when profiling?
  12. What are the limitations of profiling?

Slideset 22: Optimization II

We actually did very little from this slideset. The fundamental ideas are in slideset 21.
  1. Understand the notions of miss rate, hit rate, and miss penalty.
  2. Understand the basic strategy of writing "cache-friendly code."

Slideset 23: Amdahl's Law

  1. Understand what Amdahl's Law is and why it's important.
  2. Know the formula for computing speedup and new execution time in the context of a partial system optimization.
  3. Understand how to use Amdahl's Law as a planning tool during optimization.

Slideset 24: Linking I

  1. What is a compiler driver and why is it useful?
  2. Understand how the preprocessor, compiler, assembler, and linker act together.
  3. What is the basic problem solved by linking?
  4. What types of symbols need to be linked?
  5. Understand the need for label resolution and basically how that occurs.
  6. Understand the distinction between a symbol definition and reference.
  7. Understand what problem external references pose and how (in general) it's resolved.
  8. What are strong and weak symbols and what problem is being addressed?
  9. What are the rules in C for resolving strong/weak conflicts?

CS429 Final Exam Study Guide

What is Covered

The final exam is cumulative and covers slidesets 1-24, except 17. As usual, the test is closed book / closed notes, but you may bring two handwritten 8 1/2 by 11 inch sheets of notes (both sides) to the test.