Hexadecimal
It’s time to introduce you to the concept of hexadecimal (hex) numbers, which provide a shorthand mechanism for binary numbers. As previously discussed, analogies are made to the decimal (base 10) number system with which students are intimately familiar. You’ll also learn how to represent values in hex and how to convert between hex, binary, and decimal using basic algorithms.
-
Lecture
-
Shorts
-
Notes
-
Supplementary Resources
- Check out the following Khan Academy videos for a more comprehensive look at hexadecimal numbers! Also be sure to check out this resource, Numbers in Different Bases Visualization, created by CS50’s own Annie Chen. It’s similar to the binary bulbs widget but for hexadecimal and other bases!
- Khan Academy on Hexadecimal Number System
- Khan Academy on Binary to Hexadecimal
- Khan Academy on Decimal to Hexadecimal
-
Thought Questions
- If you knew nothing about hexadecimal, what would you guess it denoted based solely on its name?
- How would one represent the number 50 in hexadecimal using only 2 digits? 128? 256?
- Why do we have different number systems? In other words, why is decimal not enough?
- If still confused about hexadecimal, consider writing up a table with three columns–decimal, hexadecimal, and binary–and inputing values in each.