CS208 Introduction to Computer Systems Friday, 19 January 2024 + Try this 0xFFFFFFF5 (that's 7 F's, in case it's hard to read) - How many bits is this? 32 (4 bits per hexadecimal digit) - How many bytes? 4 (8 bits per byte) - If this is interpreted as a two's complement representation, what integer does it represent? 1111 1111 1111 1111 1111 1111 1111 0101 0000 0000 0000 0000 0000 0000 0000 1010 (complement) 0000 0000 0000 0000 0000 0000 0000 1011 (+1) 11 (base ten) so the original is -11. Another way: what do I need to add to this number to get 0? 0xFFFFFFF5 0xB 0x00000000 (with one bit falling into the pit) + Questions? + What's next [T 1/23] Programming assignment: bit operations & character encoding [W 1/24] Tons of info about the first exam, including a study guide [Th 1/25] A Moodle quiz about data representation ("data representation" means, for now, "how do we write and store integers and characters?") [M 1/29] Your first exam, in class; C stuff + data representation [W, F 1/31, 2/2] Start learning about machine language and assembly language [M 2/5] Midterm break + Topics between now and the exam - Bitwise operations in C - Character encodings, focusing on UTF-16 and UTF-8 - Byte order + A couple samples - integers0.c - signed integers - unsigned integers - printing an int %d, %x, %o (sadly, no %b) - printing an unsigned int %d, %x, %o - counting to infinity! - weirdest computation in two's complement! - integers1.c - writing an int to a file - byte order - printing-bytes.c ?!??! + Break...soothing ambient classroom noise... + Homework & quiz + Characters - What's a codepoint? - Unicode - Character encodings - ?? - UTF-16LE - UTF-16BE - UTF-8 <-- we'll be back here on Monday + Have a great weekend!