Monash University >
School
of Computer Science and Software Engineering >
CSE1303 >
Part B >
Lectures > Lecture B02 notes
CSE1303 Computer Science
Semester 3 (summer), 2003
Part B
Lecture B02 notes: Binary and unsigned integers
In this lecture
- Place value systems
- Decimal (base 10)
- Binary (base 2)
- Powers of two
- Converting from binary
- Assign each place a value (power of 2)
- Add place values that contain 1, ignore place values that
contain 0
- Converting to binary
- Repeated division by 2, note remainders
- Read result up page
- Hexadecimal ("hex") (base 16)
- Octal (base 8)
- Relationship between binary, hex and octal
- Group 4 binary digits for hex
- Group 3 binary digits for octal
- Using hex and octal in C programs
- Leading 0 (digit-zero) for octal
- Leading 0x (digit-zero letter-X) for hex
- Unsigned integers (n bits)
- Smallest value: all zeroes (value 0)
- Largest value: all ones (value 2n-1)
- C unsigned integer types
- unsigned char (8 bits)
- unsigned short (usually 16 bits)
- unsigned long (usually 32 bits)
- unsigned long long (usually 64 bits)
- unsigned int (usually 16 or 32 bits)
[ Top |
Home ]
Last modified 2002-12-04