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

  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.

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 8 registers and the special function of the stack pointer and base 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?
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

  1. Understand the distinction between high level languages, assembly language and machine language.
  2. Understand abstractly what the compiler and assembler do.
  3. Know the function of assembler "directives" such as .pos, .long, etc.
  4. Understand the Y86 stack discipline.
  5. Understand the different responsibilities of caller and callee in a procedure call.
  6. Be able to read and understand Y86 assembler examples.
  7. Understand the pros and cons of CISC and RISC machines.
  8. Why did CISC "win" if RISC is technologically superior?

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. Know that Intel has competitors in their market.
  4. Understand the difference in level of abstraction between C and assembly (data types, control statements).
  5. What is an ISA and what purposes does one serve?
  6. Understand the distinction between an architecture and an implementation.
  7. Know the basic steps in turning C into an executable image in memory.
  8. Understand the notion of disassembling.
  9. Understand that there are different formats for assembly (which generate the same machine code).
  10. Know the common x86 addressing modes.
  11. Understand the x86 mov instruction format and semantics.
  12. Understand the meaning and uses of the C "*" and "&" operators.
  13. Know how to dereference pointers and create addresses.
  14. Be able to interpret x86 code at the level of the examples on the slides.
  15. Be able to execute (on paper) a simple program and explain the effect on the system state (registers, flags, etc.)
  16. Understand the distinction between movl and leal.
  17. Know the basic arithmetic operations for x86.
  18. Know how to use leal 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.
  10. Don't worry about the details of the sparce switch example.

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 roles of %esp and %ebp.
  5. Be able to step through a procedure call and return.
  6. Understand the distinction between values and pointers on the stack.
  7. Know the register saving conventions (caller saved and callee saved).
  8. 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 for Linux and Windows?
  4. Be able to compute aligns 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. Review big and little endian representations of data.