Test2 is below the Test1 material.
This is a study guide for the three in-class exams for CS429. I will
leave in the material for the earlier tests, and just add to the end.
Each test will cover material that we have discussed in class, labs,
and assigned readings. 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.
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
- 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
representations.
- 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
hexadecimal number.
- 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 /
division.
- 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,
XOR.
- 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
circuit.
- 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
register files.
- 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.
Slideset 6: Instruction Set Architecture I
- 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
value returned?
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
Material from Test 1 is fair game 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: section 4.1, 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,
etc.
- 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
their features.
- 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
implementation.
- Know the basic steps in turning C into an executable image in
memory.
- 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 "&"
operators.
- Know how to dereference pointers and create addresses.
- Be able to interpret x86 code at the level of the examples on the
slides.
- 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
for.
- 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
switch.
- 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
used.
- 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
differ?
- Understand the assembly level computations for accessing arrays.
- Understand how C structures are implemented at the assembly
level.
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.