Hey aspiring coder! This quiz is your chance to become fluent in another secret computer language: Hexadecimal (or "Hex" for short)! Computers love hex because it's a super-efficient way to represent binary code in a way that's easier for humans to read.
You'll learn to switch between our everyday numbers (decimal/denary) and these powerful hex codes. This skill is vital for understanding memory addresses, color codes in web design, and even low-level programming!
Before you start the quiz, let's go through examples for both types of conversions. Understanding these steps is key!
Walkthrough:
We use "repeated division by 16" and note the remainders (just like decimal to binary, but with 16!).
Divide your decimal number by 16. Note the whole number result (quotient) and the leftover (remainder).
For 181:
You stop when the result of your division becomes 0.
Convert any remainders greater than 9 to their hexadecimal letter (A=10, B=11, C=12, D=13, E=14, F=15).
Read your hex digits from bottom to top (the last remainder you found is the first digit of your hex number).
B (from last step)
5 (from first step)
Putting them together, you get: B5.
So, the decimal number 181 is B5
in hexadecimal!
Walkthrough:
To convert from hexadecimal back to decimal, we use place values (powers of 16).
Starting from the rightmost digit, each position has a value that increases by a power of 16 as you move left:
Remember that hex letters A-F need to be converted back to their decimal equivalents first (A=10, B=11, etc.).
For our example, B5
:
Finally, add up all the calculated values:
176 + 5 = 181.
So, B5
in hexadecimal is 181 in decimal!