Lecture 2: Signed Number Representations
- 1/17/97
Finish Reading Tanenbaum Appendix A
Addition and subtraction of unsigned numbers.
Arithmetic on the circle.
Introduction to signed numbers:
One's complement - used for signed integers on some early machines.
Two's complement - standard signed representation on commercial machines.
Sign-magnitude - used to represent mantissa of floating point numbers.
Arithmetic using signed numbers.
Signed and unsigned numbers in C.
Try downloading
and compiling this simple C program
unsigned.c and experiment with the behavior
of the unsigned int data type when a value is
out of range.
SKILL: You should be able to write the bit patterns
down for 4 bit numbers and identify their equivalent decimal
representations for the four representations (unsigned, one's complement,
two's complement, sign-magnitude). You should be able to
find the representation of a number in any of the three
signed number representations. You should be able to
perform arithmetic on signed numbers in 1's complement and
2's complement.