Final exam overview and scope
The final exam may cover any material taught in class or introduced by the homework assignments. This includes, of course, any material that was in scope for the midterm. You can especially expect to see questions on the midterm topics with which students had trouble, including: machine-level representations of information and numbers; shifting and masking; etc.
The following sections give more details on topics that may be covered on the final, but these lists are not necessarily exhaustive: any material covered in the course or the assigned reading may appear on the final. You can assume that emphasis will be given to the topics that received most attention during the term.
Regarding memorization of details
In general, we will not expect you to memorize picky details of machines, languages or data formats. For example, we do expect you to understand the purpose of key components of IEEE floating-point representation, such as the significand, but if needed we will remind you that in 32 bit IEEE floats, the significand is 23 bits long.
We do expect you to
memorize the sorts of details that competent C programmers at
your level should know: for example, we expect you to know that
%s is the
printf format code for
printing a string, that
%d is for signed integers, that
int's on our systems are 4 bytes and little-endian, etc.
Regarding assembler language programming:
we will expect you to recognize the more common x86_64 instructions
mov and to know the most important
general features of the architecture, such as that
the low order 32 bits of register
not expect you to memorize details of unusual instructions
or to memorize which registers are used for which parameters
in the function linkage.
If you need such information to answer a question, we will
provide it in an appendix, just as we did for the midterm.
We do expect that you will be familiar in detail with UMASM programming, as you have been doing that for the past three weeks.
Final exam topics from the first half of term
The following list is adapted from the midterm preparation page that was posted ahead of the midterm. Any of these may be on the final as well:
- Storage of information in computer memories, including:
- Bits and their significance
- Differing interpretations of bits as numbers characters, etc
- Encodings of C language types on AMD 64 architectures including both on signed and signed (two's complement) representations; floating-point representations, etc.
- Bit masking operations, use of flags, and packing of multiple values into a single word
- Conversions between hex, binary and decimal representations
- Big endian and little endian storage conventions: you should be able to explain the differences, and to predict the bytes that will actually be stored, e.g. for some given integer or float
- Interfaces and abstraction: why they are important, and
programming techniques for implementing them
- Use of void pointers and incomplete structures for information hiding and abstraction
- Hansons's conventions for interface and ADT programming
- Polymorphism, including boxed and unboxed representations
- Invariants and why they matter
- The representation of programs in memory
- Code (text) segments, static initializing uninitialized data, Heap, stack, etc.
- The phases of program compilation, assembly, linking, etc. and have a combine to create an executable program
- Locality and caching
- What do we mean by locality, and why do programs with better locality tend to perform well?
- Basics of computer memory hierarchies: memories, caches, and registers
- differences between cache organizations: direct mapped, fully associative, and set associative
- Given details of a particular cache ( line size,
associativity, number of lines, and if appropriate replacement
policy, you should be able to explain:
- Which address bits are tagged bits, which are set selectors, and how the other bits are used for resolving memory references
- For a particular program that makes memory accesses, e.g. a program the stride through memory, what the hit rate and miss rate will be in the cache
- C programming at the level we've done on our projects
including language features such
void *, argument passing by value, use of pointers to pass arguments by reference, basic uses of #define, etc.
Final exam topics from the second half of term
The following are topics that were not included for the midterm but which may be on the final:
- Assembler programming for x86-64 (AMD 64)
- You are expected to display mastery of the same material and skills that were needed for tbe binary bomb assignment. You may be asked to write C equivalent to assembler that we provide you, or to answer other questions about the machine structure and assembler language.
- We do not expect you to be able to write extensive programs
or functions in x86_64 assembler, but we might ask you
to write short sections of code, to add a few instructions to
complete or change the
operation of a function. As noted above
you should recognize the most obvious instructions like
movbut for most details we will provide hints if you are likely to need them. For example, if we ask about function calls, we will give you the table of which parameters are passed in which registers.
- We often ask about the
leainstruction, including variants like
leal. Understand how it's used to compute arithmetic results and how it's used to compute addresses.
- Emulation and the UM:
- You should understand the architecture of the UM and the main lessons it teaches about system design (e.g. the role of registers, etc.)
- You should understand how emulators are built and why they are useful.
- You are expected to be able to read and write UMASM programs. We will give you a copy of the syntax table if we ask you to write anything non-trivial.
- Refactoring to improve code structure
- Performance and optimization
- You should have a good intuition for what takes time in a computer program (e.g. memory is perhaps 100x to 200x slower than register ops, but caching often helps)
- You should understand and recognize common optimizations done by the C compiler (e.g. moving computations out of loops where possible, avoiding recomputation of the same value even if the expression appears multiple times in the source).
- You should understand the purpose of performance tools like profilers
- You should be sure to understand inlining and specialization, as these are topics we often ask about on final exams. These are really examples of optimizations, but they are particularly important so they are listed here separately.
- You should understand strategies for testing.
- You should understand what valgrind does (not how it works inside, but what it can do for you as a programmer to help you find memory leaks and references to uninitialized memory).
Materials to review
The primary sources that are likely to be helpful to you in preparing for the test are the ones linked from our course calendar, including especially:
- All class notes including not only the PowerPoint slides used in class, but also the other notes linked from the calendar
- Bryant and O'Hallaron, especially the chapters and sections called out in the calendar
Taking the test
The following rules and procedures apply to this test:
- The test is closed book; you may not refer to books, published materials, class notes, etc. during the test.
- You may not use any calculator or other electronic device during the test
- As with the midterm, for the final we will allow you to bring one double sided sheet of notes that you have prepared yourself. The notes must be hand-written, and you will be expected to turn them in along with your finished exam.