Skip to content
All tags

#bitmask

1 posts

Bitwise Operators, Conversions, and Masks | Stanford CS107 Lecture 4

Lecture 4 first shows that signed/unsigned conversion can preserve bits while changing meaning, that mixed comparisons may surprise, and how sign extension, zero extension, and truncation alter width. It then derives AND, OR, NOT, XOR, and bitmask idioms for testing, setting, clearing, and combining fields.