|
Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring 2009
|
|
Lecture 02: Bitwise Operations; Floating Point Representations; C and Unix
Date: Friday, January 16, 2009
- Announcements
- Upcoming talk: Richard Stallman, Thursday, January 22, 5 PM.
- Upcoming career fair: Tuesday, January 27.
- Lecture assignment recap
- Wrapping up binary arithmetic
- Bit manipulations
- logical operations and shifts
- Floating-point representations
- C and Unix overview
- shiftyproduct
- hello
- gcd-c
- matmult
Due at the start of class, Tuesday, January 20.
Turn in short answers to these questions. Please turn in a hard
copy (typeset or handwritten are OK). We will discuss these questions
during class, so no late submissions are accepted.
The readings for next time are P&H Sections 2.1-2.3.
- Compute the following binary 2's complement problems in 4 bits.
Which answers to you trust?
0001 0001 1001 1111
+0101 +0111 +1111 +0101
---- ---- ---- ----
- Compute the following binary 1's complement problems in 4 bits.
Which answers do you trust?
0001 0001 0000 1000
+0101 +0111 +1111 +1111
---- ---- ---- ----
- The following problems are expressed in 8 bit, hexadecimal, 2's
complement. Compute the result as 16 bit 2's complement expressed
in hex. Which answers do you trust?
FF FF 01 4c 7f 80
+ 11 + FF + 7F x 04 x 7f x 80
---- ---- ---- ---- ---- ----
- True or false: 0.1 (base 10) can be represented as a
floating point number within the computer. Justify your answer.
- True or false: The signed product of two signed n-bit numbers
can always be correctly expressed as a signed 2n-bit number.
Justify your answer.