This is a study guide for the exams for CS429. For later tests,
scroll down. 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. (For the final, you may bring two
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, sections 4.1-2.
Also review all of the slidesets (including the one on C) through
slideset 6, slide 23.
Slideset 1: Introduction
- Understand why ints are not integers and floats are not reals.
- What is the value of knowing assembly language?
- Why does a programmer need to consider memory issues?
Slideset C: Basic C
- Know how to write simple programs in C.
- Understand the basic C data types.
- Understand at least: program structure, assignments, casting, if,
while, for, function calls, basic I/O, arithmetic and logical operators.
- Understand the #include and #define directives.
- Know how to access and use command line arguments?
- How do you compile a program using gcc?
- How can you name the output file? What if you don't name it?
- How can you get the assembler output?
- How do you run your compiled program?
Slideset 2: Bits and Bytes
- Understand the idea of representing information as bits:
integers, reals, characters, instructions.
- Understand packaging of bits into bytes, words, long words, etc.
- Know what it means to say that memory is a byte-addressable array.
- Understand the distinction between big-endian and little-endian,
and how to represent data in either format.
- Understand unsigned and signed integers and their
- Understand boolean and logical operations.
- Understand how finite sets can be represented by bit vectors.
Slideset 3: Integers
- Understand encodings of integers: unsigned and two's complement.
- Know how to interpret a bit string as binary, decimal or
- Know how to cast between signed / unsigned and what it means.
- Be able to do simple arithmetic (addition, subtraction,
multiplication, division) with signed or unsigned values.
- Understand the relation between shifting and multiplication /
- Understand sign extension.
Slideset 4: Floating Point
- Understand the analogy of floating point to scientific notation.
- Understand the representation of (some) reals in floating point.
- Be able to translate between decimal notion and FP
- Understand the distinction between normalized and denormalized numbers.
- Understand the special values (infinities and NaNs).
- Be able to round using any of the four rounding modes.
- Know the default rounding mode.
- Understand why it makes sense that that one is the default.
Slideset 5: Logic Design
- Understand the electrical nature of bits in signals.
- Know the truth tables for simple logical functions: AND, OR, NOT,
- Be able to construct truth tables for simple logical expressions.
- Know the symbols for the logic gates: AND, OR, NOT, XOR.
- Be able to read and understand a simple logic diagram composed of
gates and wires.
- Realize that it takes time for a signal to propogate through a
- Understand the logical interpretation of such a diagram.
- Understand the notion of hierarchical design (composing simpler
circuits to form more complicated circuits).
- Be able to write HCL expressions corresponding to simple circuits.
- Understand the following circuits: bit equality, word equality,
bit multiplexor, word multiplexor, 1-bit adder, 4-bit ALU.
- Know the difference between combinational and sequential circuits.
- Be able to follow the logic of simple state-holding devices:
SR flip-flops, D latches,
- Understand how latches are combined to form registers and
- Understand clock signals and why circuits are clocked.
Slideset 6: Instruction Set Architecture I
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.
- Understand what the ISA.
- How is it an abstraction layer?
- Understand the components of the Y86 processor state: registers,
condition codes, PC, status, memory.
- Know the names of the 8 registers and the special function of
the stack pointer and base pointer.
- Understand the idea of encoding instructions into bit strings.
- Don't worry about memorizing any details of the Y86 encoding.
- Understand the program stack and how it's used by Y86 programs.
- Given simple Y86 code, be able to explain what it does.
- Understand how function calls and returns occur in Y86.
- How are arguments passed to functions and how is the function
CS429 Test 2 Study Guide
What is Covered
Test 2 is cumulative but primarily covers slidesets 6-11. Note that a
portion of slideset 6 was covered on Test 1, but it's important to
know that material because it's foundational for the ISA. That
material is summarized above.
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 (continued): Instruction Set Architecture I
- Understand the distinction between high level languages, assembly
language and machine language.
- Understand abstractly what the compiler and assembler do.
- Know the function of assembler "directives" such as .pos, .long,
- Understand the Y86 stack discipline.
- Understand the different responsibilities of caller and callee in
a procedure call.
- Be able to read and understand Y86 assembler examples.
- Understand the pros and cons of CISC and RISC machines.
- Why did CISC "win" if RISC is technologically superior?
Slideset 7: ISA II
- Understand why x86 retains many arcane and obsolete features.
- There is no need to know the sequence of x86 machines or
- Know that Intel has competitors in their market.
- Understand the difference in level of abstraction between C and
assembly (data types, control statements).
- What is an ISA and what purposes does one serve?
- Understand the distinction between an architecture and an
- Know the basic steps in turning C into an executable image in
- Understand the notion of disassembling.
- Understand that there are different formats for assembly (which
generate the same machine code).
- Know the common x86 addressing modes.
- Understand the x86 mov instruction format and semantics.
- Understand the meaning and uses of the C "*" and "&"
- Know how to dereference pointers and create addresses.
- Be able to interpret x86 code at the level of the examples on the
- Be able to execute (on paper) a simple program and explain the
effect on the system state (registers, flags, etc.)
- Understand the distinction between movl and leal.
- Know the basic arithmetic operations for x86.
- Know how to use leal for basic arithmetic.
Slideset 8: ISA III
- Understand the x86 flags, what they mean, and what they are used
- Understand the cmp and test instructions.
- Know the various jumps and under what conditions they happen.
- It's not necessary to know the specific condition code expressions that
correspond to the various jumps or sets.
- Understand the structure of the x86 registers (including the byte
and word addressable portions).
- Understand how the following C constructs get compiled (if,
if-else, do-while, while, for, switch).
- Know what a jump table is and how it can be used in compiling a
- Understand under what conditions a switch might be compiled into
if-else statements, jump tables, or something else.
- Know about labels and goto's in C.
- Don't worry about the details of the sparce switch example.
Slideset 9: ISA IV
- Understand the structure of the x86 (IA32) stack and how it's
- Know how push and pop work and what they're used for.
- Understand the procedure call stack discipline (setup and tear
down of stack frames, saving and restoring registers, argument
passing, return address).
- Understand the roles of %esp and %ebp.
- Be able to step through a procedure call and return.
- Understand the distinction between values and pointers on the stack.
- Know the register saving conventions (caller saved and callee saved).
- Know what's special about compiling recursive procedures.
Slideset 10: ISA V
- Understand storage allocation for arrays.
- Be able to convert from array notation to pointer notation.
- Be able to compute addresses and values of array elements.
- Know about bounds checking in C.
- Understand the guarantees of array allocation.
- Understand nested arrays and multi-level arrays. How do they
- Understand the assembly level computations for accessing arrays.
- Understand how C structures are implemented at the assembly
Slideset 11: ISA VI
- Understand what it means to align data.
- Why would a compiler align data?
- What are the basic alignment requirements for Linux and Windows?
- Be able to compute aligns for structures.
- How might you avoid wasted space due to alignment within structs?
- Understand C unions and what they're good for.
- 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-22. 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
Readings for Test 3
You are expected to have read the following sections of Bryant and
O'Hallaron: sections 4.3 to 4.5.12, chapter 6, sections 5.1 to 5.5.
Slideset 12: Datapath I
- Understand the basic approach to designed a computer explained
very briefly on the first few slides.
- Understand the stages of the sequential Y86 implementation, what
each does, and why it's useful to consider such stages.
- Understand on a conceptual level how instruction execution maps
Slideset 13: Datapath II
- Be able to understand the type of flow diagrams in the slides
(e.g., the Fetch Logic, etc.)
- Be able to read and understand HCL descriptions describing
signals in the architecture.
- Understand how signals propogate through the architecture.
- Understand the limitations of a sequential (non-pipelined)
implementation of any processor.
- Understand the notion of clocking.
Slideset 14: Pipeline I
- Understand the concept of pipelining and why it's useful in
- Understand the notion of sequential implementation as the
execution model that a pipelined architecture must emulate.
- Understand pipeline stages, pipeline registers, latency and throughput.
- Be able to compute latency and throughput for sample pipelines
(uniform and non-uniform).
- Know the performance equation for pipelines.
- Understand the notion of cycles per instruction.
- How does pipelining impact performance?
- What is a data dependency and how are they manifest?
- What are data hazards?
- What challenges do data hazards present for pipelined architectures?
Slideset 15: Pipeline II
- Understand the need for pipeline registers in the implemention.
- Know the pipeline stages in the Y86 PIPE architecture and what
- You don't need to know all the signals or wires in PIPE.
- What are data hazards and control hazards?
- What instruction types tend to produce data/control hazards?
- Understand how data dependencies affect the pipeline.
- Understand how inserting NOPs could help.
- In what circumstances is predicting the PC a problem, and why?
- Understand the Y86 strategy for predicting the PC.
- How do you recover from a PC misprediction?
- What are the options for dealing with hazards?
- What is stalling and how is it implemented?
- What is a bubble and how is it implemented?
Slideset 16: Pipeline III
- What does data forwarding accomplish?
- What are the limitations of forwarding?
- What is a load/use hazard?
Slideset 17: Pipeline IV
- Understand the idea of performance analysis with pipelining.
- Understand the factors that go into computing CPI.
- Why doesn't an N-stage pipeline typically speed up throughput by
a factor of N?
Slideset 18: Storage Technologies
- Understand the notions or RAM and ROM.
- Understand DRAM and SRAM and their relative characteristics.
- How is DRAM accessed?
- How are memory modules constructed from DRAM?
- Understand volatile vs. non-volatile memories.
- Understand what a bus does in a system and how one is accessed.
- Understand how rotating disks are constructed and accessed.
- Know how to compute disk capacity.
- What are the components of disk access and their relative
- How do disks compare to DRAM and SRAM?
- What do logical disk blocks accomplish?
- Understand the basics of solid state disks and how they compare
to other technologies.
- Understand the CPU-Memory gap and its implications.
Slideset 19: Cache I
- Understand the importance of locality in a program.
- Know the difference between spacial and temporal locality and
how a program might manifest either.
- Be able to recognize good/bad locality in a program.
- What does stride-k behavior mean?
- Understand the basic idea of a memory hierarchy.
- What typically changes as you go up/down the hierarchy?
- Understand what caching means and why it's used.
- Understand: cache hit, cache miss, victim, replacement strategy,
placement strategy, cold miss, conflict miss, capacity miss.
Slideset 20: Cache II
- Understand the fundamentals of organizing a cache memory: sets,
lines, blocks, tags, valid and dirty bits.
- Understand how a cache is accessed given an address.
- Given parameters of a cache, be able to compute hits and misses
from sample input.
- Understand direct-mapped vs. set associative caches.
- Understand write-back and write-through.
- Understand write-allocate and no-write-allocate.
- What factors affect average memory access time (AMAT)?
- How can a programmer improve performance by writing
Slideset 21: Optimization I
- What are the strengths and limitations of optimizing compilers in
improving program performance?
- Understand code motion and when it's useful.
- What is reduction in strength and when is it useful?
- How can the programmer influence the compiler to favor registers over memory?
- Why is CPE a more useful measure of efficiency than absolute time?
- What is loop unrolling and how is it useful?
- Why is a procedure call often considered an "optimization blocker"?
- Read and understand the Vector ADT example as an exemplar
of hand optimization techniques.
- What is memory aliasing and why is it considered an optimization blocker?
- Understand the notion of common subexpressions and their role in
- How is profiling used in code optimization? What does one look
for when profiling?
- 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.
- Understand the notions of miss rate, hit rate, and miss penalty.
- Understand the basic strategy of writing "cache-friendly code."
CS429 Final Exam Study Guide
What is Covered
The final exam is cumulative and covers slidesets 1-24. 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.
Readings for Test 4
You are expected to have read all of the previously assigned sections
of Bryant and O'Hallaron. The sections for which you are responsible
but which have not been covered on previous exams are: sections
5.5-5.9, 5.14-3, and 5.15; sections 7.1 to 7.6.
Slideset 20B: Amdahl's Law
- Understand what Amdahl's Law is and why it's important.
- Know the formula for computing speedup and new execution time in
the context of a partial system optimization.
- Understand how to use Amdahl's Law as a planning tool during
Slideset 23: Linking I
- What is a compiler driver and why is it useful?
- Understand how the preprocessor, compiler, assembler, and linker
- What is the basic problem solved by linking?
- What types of symbols need to be linked?
- Understand the need for label resolution and basically how that
- How does a one-pass differ from a two-pass assembler?
- What is the symbol table for?
- Understand (in general) how the linker: merges object files,
resolves external references, and relocates.
- How do linkers enhance modularity and efficiency?
- What is an ELF file and what role does it play in
linking? You don't have to know the details of the various
- What is the difference between relocatable object files and
Slideset 24: Linking II
- Understand the distinction between a symbol definition and reference.
- Understand what problem external references pose and how (in
general) it's resolved.
- What are strong and weak symbols and what problem is being addressed?
- What are the rules in C for resolving strong/weak conflicts?
- What is the distinction between static and dynamic libraries?