CS208 Introduction to Computer Systems Wednesday, 14 January 2026 + Try these questions for fun - How many hexadecimal digits does it take to write one byte? - What's the hexadecimal representation of the ASCII value of the space character? ("man ascii" is a handy command on most Unix systems) - What integer does this int's 32-bit value represent? 0xFFFFFFF3 - What int do you have to add to 0xFFFFFFF3 to get 0? + Topics coming up - Two's complement recap - Byte order ("little endian" vs. "big endian") - Representing characters - ASCII - Unicode - Encodings: UTF-16LE, UTF-16BE, UTF-8 + Recap: N-bit two's complement integer representation - Recognizing >= 0 vs. < 0 integers (leftmost bit = 1 ==> # is negative) - Negation: complement, then add 1 - Addition works - Negatives: "what do I have to add to this number to get 0?" - char (8-bit = 1-byte integer) vs. short (16-bit = 2-byte) vs. int (32-bit = 4-byte) vs. long (64-bit = 8-byte) These bit lengths are compiler-dependent + Byte order - The problem - The two solutions - Why it's all kinda sad + Characters - https://sandbox.jeffondich.com/encoder - International agreements mapping character <--> integer - ASCII [but remember "A" stands for "American"] - ISO-8859-1 ["I" stands for "International"] - Unicode - "codepoint" - the integer that represents one character U+00E9 <-> é - "encoding" -- and why it's different from "codepoint" - given a codepoint, how am I going to store it as a byte sequence? (in memory or in a file) - Easy encodings - UTF-16LE α <-> U+03B1 <-> B1 03 [2-byte sequence] - UTF-16BE α <-> U+03B1 <-> 03 B1 [2-byte sequence] ---- - Harder, but important - UTF-8