CompOrg Fall 2002 Test #1 Topics


Test #1 will be given in class on Thursday, October 3rd. The test is closed book, no notes or computers are allowed.

A IA32 Instruction reference will be distributed with the test (this covers only the instructions that we have covered so far). Here is the reference: cribsheet.pdf

Topic What to know What to expect on the test

Integer representation
  • Binary representation (base 2)
  • Hexadecimal (base 16)
  • Unsigned integers
  • Two's Complement Integers
  • C programs and integer data types.
  • Conversion between integer representations
  • Understand or write small C programs that deal with integers
  • Know how to use printf!

  • IEEE Single Precision
  • Sign, Exponent & Significand
  • Exponents are stored using bias representation
  • Normalization
  • Significands are represented as normalized without the leading 1
  • C programs and floats.
  • Be able to show the bits of an IEEE single precision floating point number given a decimal floating point number.
  • Be able to discuss the issues involved with designing a binary representation for floating point numbers (the tradeoff between the number of bits used to store the exponent vs. the number of bits used to store the significand).
  • Understand what normalization is, and why it is important in IEEE single precision representation.
  • Be able to write/understand small C programs that deal with floats.

  • Computer Arithmetic & Logic Operations
  • Bitwise logic operations (AND/OR/NOT)
  • Unsigned addition
  • Signed addition
  • Overflow
  • Be able to write and/or understand C programs using the C operators &, | and ~.
  • Understand the limitations of integer arithmetic when using a fixed size representation.
  • Be able to write/understand C programs that do integer arithmetic operations.

  • Unix
  • There will not be any Unix questions on the test.
  • It can't hurt to know how to spell Unix

  • Instruction Sets
  • Instruction Set Architecture (stack, accumulator, general purpose register)
  • Machine-Level Code (program representation)
  • C -> Assembly -> Machine Code
  • Be able to compare instruction set architectures and some of the tradeoffs (instruction size vs flexibility).
  • Understand that machine code is a binary representation of instructions. Be able to design a machine code (a binary encoding), given a small set of operations. This is like the example we did in class (Machine language for Life: eat, play, study, watch TV,...).
  • Be able to discuss (at a general level) what a compiler does, and what an assembler does.

  • IA32 Instructions
  • Registers
  • movl instruction
  • Addressing Modes
  • Arithmetic/Logic instructions
  • Condition Codes
  • Set instructions
  • Compare instructions
  • Jump instructions
  • Be able to decipher (explain what happens) some small assembly language program segments that include the instructions we have covered.
  • Be able to write some assembly language given a small segment of C code.
  • Be able to do some assembly language optimization. Given some assembly language code - write a more efficient version.
  • Be able to create assembly language for C If statements, but don't worry about loops...
  • The test will include a list of the instructions we have covered (you don't need to memorize names). The complete instruction reference that will be attached to the test is here: cribsheet.pdf
  • Test Info, What to Study

    Practice Problems:

    Practice assembly language! Try to work out some of the Practice Problems in the text. Also look at homework problems 3.31 and 3.32.

    Play with C computer arithemtic (on the computer!). Make sure you understand what happens when you add or multiply signed/unsigned values.

    Make sure you know how to extract bits from any C variable! (you did this on both homeworks!)

    Two's complement, Two's complement, Two's complement