Test #1 will be given in class on Thursday, Sept 29th.
The test is closed book, no notes or computers are allowed.
| Topic |
What to know |
What to expect on the test |
| General Representation |
- Everything is represented in binary
- Bits, Bytes, Words
- Text (ASCII encoding)
- C programs and text representation.
|
- Be able to create an encoding of some instructions
(something like our "machine code for life").
- Given an ASCII chart, be able to show how a particular
string would be represented in a C program (null terminated sequence
of ASCII values).
- How many bits in a byte.
- Byte ordering issues (little-endian vs. big-endian).
|
| 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
|
- 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.
|
| Computer Arithmetic & Logic Operations |
- Bitwise logic operations (
&, |, ~)
- Boolean logic operations (
&&, || , !)
- 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.
- Be able to discuss how overflow can be detected after an
integer addition operation.
|
| Unix |
- Be able to spell Unix.
- Be able to list at least 4 Unix commands (things like
"ls", "cd", "mkdir", "chmod", ...)
|
- Expect a question like "which Unix editor is the
best?". Of course the only answer is
pico
vi
vim
emacs...
|
| C Programming |
- printf
- C programming data types (char, int, etc)
- C logic operation usage
- pointers, pointers, pointers
|
- Be able to determine what a C program prints out (know printf!).
- Be able to write small C programs that deal with pointers,
logic operations, printf, etc.
|
| Instruction Sets |
- Instruction Set Architecture (stack, accumulator, general
purpose register)
- Machine-Level Code (program representation, like the
"Machine Language for Life" )
|
- 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.
|
Test Info, What to Study
Practice Problems:
- 2.1,
2.2, 2.3, 2.5
2.6, 2.7,2.8, 2.11, 2.13,
2.14, 2.15,
2.20, 2.21,
2.23,
2.29, 2.30,
2.31, 2.33,
2.41, 2.42, 2.43,2.54
Play with C computer arithmetic (on the computer!). Make sure you
understand what happens when you add signed/unsigned
values.
Make sure you know how to extract bits from any C variable!
Make sure you understand that a pointer variable is just a number
that is treated as an address.
Two's complement, Two's complement, Two's complement
Review the labs (make sure you understand what you did) and make
sure you can do HW1!!!!.
Look at last semester's test:
Spring 2005 Test 1 (with answers)
Sample Questions:
Write a C function that returns the number of bits in a 32-bit
integer that are set to 1.
Write a C function that reverses a string (passed a char
*).
What does this print out?:
int x=14;
char *p = (char *) x;
char c;
printf("%d %x\n",x,p);
c = 's';
printf("%c\n",c);
printf("%d\n",c);