Week 1 Tutorial - Data Representation

1  Introduction

2  Integers

128 64 32 16  8   4   2   1 
0 1 1 0 1 0 0 1

2.1  Hexadecimal Bit Patterns

0000 = 0 1000 = 8
0001 = 1 1001 = 9
0010 = 2 1010 = A
0011 = 3 1011 = B
0100 = 4 1100 = C
0101 = 5 1101 = D
0110 = 6 1110 = E
0111 = 7 1111 = F

2.2  Rules of Addition and Subtraction

2.3  Signed Integers

     short a;           # 16-bit signed storage
     unsigned short b   # 16-bit unsigned storage;
         00000101     +5 
       + 10000011     -3, note the sign bit on the left
        ----------
         10001000     i.e. -8

2.4  Twos-Complement Notation

        11111101
      + 00000011
       ----------
        00000000 
-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7
1000 1001 1010 1011 1100 1101 1110 1111 0000 0001 0010 0011 0100 0101 0110 0111

2.5  Endianness

3  Characters and Strings

3.1  Unicode

4  Representation of Floating-Point Numbers

4.1  Design Goals

4.2  Scientific Notation

4.3  The IEEE 754 Floating-point Standard

4.4  Some Examples of IEEE 754 Numbers

4.5  Other Features

4.6  Sorting Floating Point Numbers

4.7  More Information




File translated from TEX by TTH, version 3.85.
On 19 Jan 2012, 06:12.